Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 63527 - Unknown hostname
Summary: Unknown hostname
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Docs Team
URL:
Whiteboard:
Keywords:
: 53803 104866 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-09-10 02:53 UTC by Michal Margula
Modified: 2005-09-05 02:08 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michal Margula 2004-09-10 02:53:44 UTC
When installing Gentoo, user needs to do following things:

- put hostname into /etc/hostname
- put domain name into /etc/dnsdomainname
- execute: rc-update add domainname default

But it only sets hostname, domain name is still empty. Restarting domainname service does not help. Command "hostname" shows empty and in login issue file you can see hostname.(none) where in place of "(none)" should be our domain.
Comment 1 Michal Margula 2004-09-10 08:06:39 UTC
Sorry, correction:

Command "domainname" shows empty and in login issue file you can see "hostname.(none)" where in place of "(none)" should be our domain name.
Comment 2 SpanKY gentoo-dev 2004-09-10 15:58:19 UTC
hostname works off of input in /etc/hostname

domainname is for NIS/YP not DNS

dnsdomainname works off of the input from /etc/hostname and requires that the hostname be FQDN and resolvable (via the resolver library ... that means the nameservers in /etc/resolv.conf or the settings in /etc/hosts must provide the info)

for more info, see `man hostname`
Comment 3 Michal Margula 2004-09-12 09:58:24 UTC
I am afraid that you are not right.

First thing - Gentoo Installation Handbook states clearly that you need to put your hostname (there is nothing about FQDN!!!) into /etc/hostname and your domain name into /etc/dnsdomainname

Second thing - if you even put FQDN into /etc/hostname issue shows then "FQDN.host.name.(none)" so it is still WRONG.

And by the way:

bash-2.05b$ cat /etc/dnsdomainname 
uznam.net.pl
bash-2.05b$ dnsdomainname 
bash-2.05b$ cat /etc/hostname
cerber
bash-2.05b$ hostname
cerber


And yes - my hostname is resolvable via DNS servers and also it is put in /etc/hosts to be completly sure.
Comment 4 Xavier Neys (RETIRED) gentoo-dev 2004-09-13 04:14:58 UTC
Let's straighten this one out, shall we?

/etc/hostname should contain your hostname, nothing else, not a FQDN.
From our own /etc/init.d/hostname
"""
        # We use whatever is in /etc/hostname here.  That means:
        #
        # 1)  For doing it the proper way, you should NOT put a
        #     FQDN in there, but:
        #     a) Only have the hostname in there (no dns/nis domainname)
        #     b) Set the dnsdomainname via /etc/resolv.conf
        #     c) Set the nisdomainname via 'domainname'.
        #
        # 2)  If the user want a FQDN in there, it should be possible
        #     without hacking things to pieces, but then he should
        #     know what he is doing ...
        #
"""

You could define your domain name in /etc/dnsdomainname and add domainname to your runlevel, but all this does is rewrite the domain line in your /etc/resolv.conv at every boot.

In short,
 host name goes into /etc/hostname
 domain name goes into /etc/resolv.conf

e.g.
neysx@basil ~ $ cat /etc/resolv.conf
domain a.la.maison
nameserver 10.0.0.1
neysx@basil ~ $ cat /etc/hostname
basil
neysx@basil ~ $ cat /etc/hosts
127.0.0.1       localhost
10.0.0.2        basil.a.la.maison  basil
10.0.0.123      moose.a.la.maison  moose
neysx@basil ~ $ hostname
basil
neysx@basil ~ $ hostname -f
basil.a.la.maison
neysx@basil ~ $ dnsdomainname
a.la.maison


Hth
Comment 5 Michal Margula 2004-09-13 04:29:55 UTC
I have everything configured the same way, except one thing, I had:

my.ip.addr.ess cerber cerber.uznam.net.pl

after reversing it to:

my.ip.addr.ess cerber.uznam.net.pl cerber

Everything went trough without problems. I am wondering if it is worth mentioning in Gentoo handbook? If not, please close that bug and forget about it. Thanks.
Comment 6 Xavier Neys (RETIRED) gentoo-dev 2004-09-13 04:56:46 UTC
/etc/hosts wants
 your.ip.add.ress canonical_hostname alias(es)
just like in the above sample, just like you've done, just like in the handbook.

If you get (none) from your /etc/issue, check that you're not using \o (lowercase letter O) which is for nis domains, use \O instead (uppercase letter O)
Available escapes are documented in `man agetty`
Comment 7 SpanKY gentoo-dev 2004-10-09 16:41:01 UTC
*** Bug 53803 has been marked as a duplicate of this bug. ***
Comment 8 Jakub Moc (RETIRED) gentoo-dev 2005-09-05 02:08:21 UTC
*** Bug 104866 has been marked as a duplicate of this bug. ***