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
--
[email protected] mailing list