[gentoo-user] Why the changes to /etc/nisdomainname etc

2005-06-23 Thread Jim Hatfield
I'm trying to move from a Unix-based DNS to an AD setup, 
changing DNS domain name (but not NIS domain name) in the
process. I'm testing by switching DHCP servers on and off.

I had a problem with NIS and while investigating noticed that
some key files seem to have changed since the last time I
rebooted the machine some months ago:

/etc/hostname   -  /etc/conf.d/hostname
/etc/dnsdomainname  -  /etc/conf.d/domainname
/etc/nisdomainname  -  /etc/conf.d/domainname

Is there any reason for this? Was something broken with
the old way of doing it?

Given that the DHCP server gives out the hostname and
DNS and NIS domain names, should these files be left
empty?

/etc/conf.d/domainname is a bit confusing:

#DNSDOMAIN=

# This only set what /bin/hostname returns.  If you need to setup NIS, meaning
# what /bin/domainname returns, please see:
#
#   http://www.linux-nis.org/nis-howto/HOWTO/
#
NISDOMAIN=insignia

Which line does that comment refer to, the one above or the
one below?

Jim

-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] Why the changes to /etc/nisdomainname etc

2005-06-23 Thread Jim Hatfield
On Thu, 23 Jun 2005 12:35:46 +0100, Jim Hatfield
[EMAIL PROTECTED] wrote:

Given that the DHCP server gives out the hostname and
DNS and NIS domain names, should these files be left
empty?

Answering my own mail.
If /etc/conf.d/hostname and /etc/conf.d/domainname are
both blank, we get:

(none) ~ # hostname
(none)
(none) ~ # nisdomainname
(none)
(none) ~ # dnsdomainname
dnsdomainname: Unknown host
(none) ~ # cat /etc/resolv.conf
nameserver 172.16.64.1
nameserver 172.18.1.1
search isltd.insignia.com
(none) ~ #

So even though the DNS domain name was delivered by the DHCP server
it was only used for /etc/resolv.conf. And the hostname seems to be
set from /etc/conf.d/hostname well before DHCP is activated.

So I set /etc/conf.d/hostname and try again:

terminator ~ # hostname
terminator
terminator ~ # dnsdomainname
isltd.insignia.com
terminator ~ # nisdomainname
(none)
terminator ~ # cat /etc/resolv.conf
nameserver 172.16.64.1
nameserver 172.18.1.1
search isltd.insignia.com

Hmm. So if I set the hostname, the DNS domain name is set from DHCP,
but not if I don't. Weird. The same happens if instead of setting
the hostname in /etc/conf.d/hostnanme, I set dhcpcd_eth0=-H in
/etc/conf.d/net.

It would be nice if the NIS domain name could be picked up from DHCP,
is there a way to do that? The info returned is picked up because
/etc/yp.conf is set to:

domain insignia broadcast

but that doesn't seem to be enough for ypbind.

Also /etc/init.d/domainname looks like it is supposed to put a domain
line in /etc/resolv.conf:

[[ ${OVERRIDE} == 1 ]] \
 resolv=${resolv}$'\n'domain ${DNSDOMAIN} \
|| resolv=domain ${DNSDOMAIN}$'\n'${resolv}
echo ${resolv}  /etc/resolv.conf

but as you see above this does not happen, or it is overwritten later.

Once I can sort this out I can move on to my real problem, which is
that changing the DNS domain name in the DHCP server stops NIS
working. But that's for another mail.

Jim

-- 
gentoo-user@gentoo.org mailing list