I can confirm this issue in Ubuntu edgy server. When connecting to two
separate host networks, with their own dhcp servers respectively, the
newest registration overwrites the nameserver entry in
/etc/resolve.conf.

To demonstrate, take for example, interfaces eth0 and eth1 which connect
to the two respective dhcp networks. Use the 'dhclient <interface>'  and
cat /etc/resolve.conf to see how the file changes. E.g.

$ cat /etc/resolv.conf 
search localdomain
nameserver 172.16.254.2
$
$ sudo dhclient eth0
[... warning about killing previous dhclient process]
Listening on LPF/eth0/00:0c:29:ba:1e:2d
Sending on   LPF/eth0/00:0c:29:ba:1e:2d
Sending on   Socket/fallback
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPACK from 192.168.60.254
bound to 192.168.60.128 -- renewal in 689 seconds.
$
$ cat /etc/resolv.conf 
search localdomain
nameserver 192.168.60.1

"nameserver 172.16.254.2" was set for eth1, but when dhcpclient renews
the lease for eth0, it is overwritten by "nameserver 192.168.60.1".

This can causes havoc with host lookups failing or one or the other
side. You can manually append the missing nameserver to
/etc/resolve.conf, but it gets overwritten as soon as a lease is
renewed. E.g.

$ sudo echo "nameserver 172.16.254.2" >> /etc/resolve.conf
(or use a suitable text editor, i.e. nano, vim, gedit)

There is a workaround with the dhclient.conf file.  Refer to man
dhclient.conf. One can hardcode DNS nameservers in with prepend. E.g.
add the following line to /etc/dhcp3/dhclient.conf:

prepend domain-name-servers 192.168.60.1, 172.16.254.2;

Now, no matter when dhclient gets new leases, it will first place those
name servers in /etc/resolve.conf. Note, this is more of a hard-coded
hack. 1. The dns server address may change, and 2. duplicate entries may
result in /etc/resolve.conf.

Another avenue to look at is installing resolveconf

-- 
One DNS by DHCP setting overwrites another
https://launchpad.net/bugs/59375

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to