View previous topic :: View next topic |
Author |
Message |
curmudgeon Veteran
Joined: 08 Aug 2003 Posts: 1744
|
Posted: Sun May 27, 2012 7:51 am Post subject: Where does the domain name come from? |
|
|
Can someone tell me where /etc/init.d/hostname script (when run at boot) gets the domain name from? |
|
Back to top |
|
|
Hypnos Advocate
Joined: 18 Jul 2002 Posts: 2889 Location: Omnipresent
|
|
Back to top |
|
|
toralf Developer
Joined: 01 Feb 2004 Posts: 3942 Location: Hamburg
|
Posted: Sun May 27, 2012 9:59 am Post subject: |
|
|
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 |
|
|
Hypnos Advocate
Joined: 18 Jul 2002 Posts: 2889 Location: Omnipresent
|
Posted: Sun May 27, 2012 10:20 am Post subject: |
|
|
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 |
|
|
toralf Developer
Joined: 01 Feb 2004 Posts: 3942 Location: Hamburg
|
Posted: Sun May 27, 2012 10:48 am Post subject: |
|
|
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 |
|
|
mv Watchman
Joined: 20 Apr 2005 Posts: 6780
|
Posted: Sun May 27, 2012 11:06 am Post subject: |
|
|
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 |
|
|
Hypnos Advocate
Joined: 18 Jul 2002 Posts: 2889 Location: Omnipresent
|
|
Back to top |
|
|
toralf Developer
Joined: 01 Feb 2004 Posts: 3942 Location: Hamburg
|
Posted: Sun May 27, 2012 12:11 pm Post subject: |
|
|
Hypnos wrote: | I read "domain name" as "hostname" in the OP. | FUnny enogh - your answer seems to be right nevertheless |
|
Back to top |
|
|
javeree Guru
Joined: 29 Jan 2006 Posts: 455
|
Posted: Wed May 30, 2012 9:01 am Post subject: |
|
|
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 |
|
|
xaviermiller Bodhisattva
Joined: 23 Jul 2004 Posts: 8723 Location: ~Brussels - Belgique
|
Posted: Wed May 30, 2012 9:08 am Post subject: |
|
|
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 |
|
|
Evileye l33t
Joined: 06 Aug 2003 Posts: 782 Location: Toronto
|
Posted: Thu May 31, 2012 8:38 pm Post subject: |
|
|
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 |
|
|
|