Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Where does the 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
curmudgeon
Veteran
Veteran


Joined: 08 Aug 2003
Posts: 1744

PostPosted: Sun May 27, 2012 7:51 am    Post subject: Where does the domain name come from? Reply with quote

Can someone tell me where /etc/init.d/hostname script (when run at boot) gets the domain name from?
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2889
Location: Omnipresent

PostPosted: Sun May 27, 2012 8:16 am    Post subject: Reply with quote

/etc/conf.d/hostname
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3942
Location: Hamburg

PostPosted: Sun May 27, 2012 9:59 am    Post subject: Reply with quote

Hypnos wrote:
/etc/conf.d/hostname
IMHO wrong.

I've :
Code:
tfoerste@n22 ~ $ cat /etc/conf.d/hostname
# Set to the hostname of this machine
hostname="n22"
and /et/issue shows my domain name if I use "\O" instead the default "\o"[code]:[code]tfoerste@n22 ~ $ cat /etc/issue

This is \n.\O (\s \m \r) \t
[/code]
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2889
Location: Omnipresent

PostPosted: Sun May 27, 2012 10:20 am    Post subject: Reply with quote

The Gentoo Handbook specifies /etc/conf.d/hostname as the place. If /bin/hostname doesn't show the same hostname after /etc/init.d/hostname is invoked, then that's a bug.

It is true that \O in /etc/issue displays the FQDN, and not just the hostname. This is equivalent to "hostname -f" .
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3942
Location: Hamburg

PostPosted: Sun May 27, 2012 10:48 am    Post subject: Reply with quote

Hypnos wrote:
The Gentoo Handbook specifies /etc/conf.d/hostname as the place.
That documents says :
Quote:
Second, if you need a domainname, set it in /etc/conf.d/net.
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6780

PostPosted: Sun May 27, 2012 11:06 am    Post subject: Reply with quote

Every script from /etc/init.d inherits the variables set in /etc/conf.d/$same_name. Whether it uses these variables depends on the script, but an inspection of /etc/init.d/hostname shows that this script obviously uses the variable defined there for the call of the hostname binary.
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2889
Location: Omnipresent

PostPosted: Sun May 27, 2012 11:40 am    Post subject: Reply with quote

I'm an idiot -- I read "domain name" as "hostname" in the OP.

:oops:
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3942
Location: Hamburg

PostPosted: Sun May 27, 2012 12:11 pm    Post subject: Reply with quote

Hypnos wrote:
I read "domain name" as "hostname" in the OP. :oops:
FUnny enogh - your answer seems to be right nevertheless ;-)
Back to top
View user's profile Send private message
javeree
Guru
Guru


Joined: 29 Jan 2006
Posts: 455

PostPosted: Wed May 30, 2012 9:01 am    Post subject: Reply with quote

That is also where I set my domain name.

Quote:
hostname="Myhostname.mydomain"


However, I see when I start up, my logon prompt says:

This is user at Myhostname.mydomain.mydomain
(or something to that effect, I don don have access to that pc now.

So I guess there is still a second location where the domain name is set, or it is reinterpreted a second time.
however, the only place where I explicitly mention the domain name is in the dnsmasq configuration (this PC is acting as a router).

DNSMASQ_OPTS="$DNSMASQ_OPTS --domain-needed --domain=mydomain"
Back to top
View user's profile Send private message
xaviermiller
Bodhisattva
Bodhisattva


Joined: 23 Jul 2004
Posts: 8723
Location: ~Brussels - Belgique

PostPosted: Wed May 30, 2012 9:08 am    Post subject: Reply with quote

Try to set your domain name in /etc/hosts

Something like

Code:
127.0.0.1 hostname.domainname hostname localhost

_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
Evileye
l33t
l33t


Joined: 06 Aug 2003
Posts: 782
Location: Toronto

PostPosted: Thu May 31, 2012 8:38 pm    Post subject: Reply with quote

In /etc/hosts you should have something like...

Code:
192.168.0.1     hostname.domain.com      hostname


...obviously replacing hostname and domain.com with whatever you are using.
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