Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
where does domain name come from?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
rhumbliner
n00b
n00b


Joined: 15 Nov 2004
Posts: 51
Location: Las Vegas

PostPosted: Sat Oct 05, 2013 3:15 pm    Post subject: where does domain name come from? Reply with quote

i ran across an interesting problem today. i'm maintaining several servers and typically set the domain name in the hosts file:
Code:
10.1.1.5  server1.mydomain.com


but when building a new server i overlooked the hosts entry and was surprised to see that it picked up the correct domain name anyway. a little research showed i had this line in /etc/resolv.conf:
Code:
search mydomain.com


i decided this was a cleaner method for setting the domain name so i adjusted my other servers so that hosts simply lists the hostname and resolve.conf lists the domain name. problem is, that method only works for my new server and not the rest. what am i missing here?

in summary, this setup works on some machines but not others:
/etc/hosts
Code:
10.1.1.5  server1

/etc/resolv.conf
Code:
search mydomain.com

Code:
hostname -f
server1.mydomain.com


tia
Back to top
View user's profile Send private message
Jaglover
Advocate
Advocate


Joined: 29 May 2005
Posts: 4560
Location: Saint Amant, Acadiana

PostPosted: Sat Oct 05, 2013 4:39 pm    Post subject: Reply with quote

What's in

/etc/conf.d/hostname
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
rhumbliner
n00b
n00b


Joined: 15 Nov 2004
Posts: 51
Location: Las Vegas

PostPosted: Sat Oct 05, 2013 9:03 pm    Post subject: Reply with quote

Code:
{~} cat /etc/conf.d/hostname
# Set to the hostname of this machine
hostname="server1"
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum