On Friday 13 October 2006 16:10, Neil Bothwick wrote:

> On Fri, 13 Oct 2006 15:43:17 +0200, Alan McKinnon wrote:
> > It's now set in /etc/conf.d/net
>
> And has been discussed at great length on this list over the last few
> weeks.
>
> > The process is fully documented in /etc/conf.d/net.example and the
> > old domainname file is deprecated (or is that obsoleted?)
>
> Obsoleted, it no longer works.

Well, I'm not using /etc/domainname, but I had the same problem in a 
recent 2006.1 install (only a single ethernet interface, eth0).

------------------------------------------
# cat /etc/conf.d/net

# comments removed
config_eth0=( "dhcp" )
dhcpcd_eth0="-t 30"

dns_domain_lo="my.domain"   # as per the handbook
------------------------------------------
# cat /etc/conf.d/hostname
# /etc/conf.d/hostname

# Set to the hostname of this machine
HOSTNAME="saturn"
------------------------------------------
# cat /etc/hosts

# comments removed

# IPv4 and IPv6 localhost aliases
127.0.0.1       localhost.localdomain localhost
::1     localhost
------------------------------------------
# cat /etc/resolv.conf

# Generated by dhcpcd for interface eth0
nameserver 10.0.0.1
------------------------------------------

With the above setup, hostname -d and dnsdomainname were failing 
with "Unknown host", and the login prompt was showing "This is 
saturn.unknown_domain".

I tried setting dns_domain_eth0="my.domain" in /etc/conf.d/net, with no 
luck. As the comment in that file notes, for this explicit dns domain 
setting to work, dns_servers_eth0 must be set, which it is not, since I 
get the dns server address from dhcp. 

So, I edited again /etc/conf.d/net, added the "nodns" option to the 
dhcp_eth0, and set the dns_server_eth0="10.0.0.1" and the 
dns_somain_eth0="my.domain" lines. Still no go.

I noticed that my DHCP server does not send a domain name to che client, 
but only an IP address and a DNS address (as can be seen 
in /etc/resolv.conf). However, if I edit /etc/resolv.conf and add 
a "domain my.domain" line, hostname -d still does not work.

I tried changing the order of options in /etc/nsswitch.conf 
and /etc/host.conf, still with no result.

Of course, after each of these changes did a full reboot to test them, 
even though a restart of eth0 could probably have been enough. And, 
after seeing the failure, I restored all the chianges to the previous 
state.

Eventually, I edited /etc/hosts and added a line reading

10.0.0.14   saturn.my.domain   saturn

and everything started working. Seems like, on this box, dnsdomainname 
and agetty (or, more likely, glibc's lookup routines) only 
read /etc/hosts.

The solution I found is clearly a workaround, since no doc I have read 
mentions that the programs that read the dns domain name rely 
on /etc/hosts, and I'd like to know if the result can be obtained in a 
cleaner way. I read all the notes in /etc/conf.d/net.example. Did I miss 
something?

Thanks for any help.
-- 
gentoo-user@gentoo.org mailing list

Reply via email to