dhclient append settings from multiple DHCP servers
Posted
by
Brian
on Server Fault
See other posts from Server Fault
or by Brian
Published on 2011-01-17T16:41:58Z
Indexed on
2011/01/17
16:55 UTC
Read the original article
Hit count: 257
I have a server with two interfaces connected to two separate networks, using DHCP for both. When dhclient is writing /etc/resolv.conf
, I would like it to append settings that aren't already there. For instance, if I receive from one DHCP server:
nameserver 10.0.0.1
search one.mydomain.com
and from another:
nameserver 10.1.1.254
search two.mydomain.com
Then resolv.conf should look like this:
search one.mydomain.com two.mydomain.com
nameserver 10.0.0.1
nameserver 10.1.1.254
At the moment, it seems the last dhclient overwrites whatever was there. I know I can preconfigure settings in dhclient.conf using supercede
or append
, but then I have to hard-code the values. I've scoured the man page for dhclient, but it seems like dhclient prefers to work alone (i.e. not in conjunction with any other dhclients)...or am I missing something?
© Server Fault or respective owner