Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:


and from another:


Then resolv.conf should look like this:


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?

share|improve this question
up vote 2 down vote accepted

It seems, the most apropriate way is to use custom dhclient-script for each interface and write DNS parameters in separate files (i.e. /etc/resolv.d/eth[01]) and then call script that merges all these files in global /etc/resolv/conf

share|improve this answer
Something along those lines seems appropriate but this seems like a fundamentally very weird way to go about things. – Phil Hollenback Jan 17 '11 at 17:53
Other way that I can see - patch or rewrite dhclient itself :) Using dhclient-script is a bit easier. – gelraen Jan 17 '11 at 18:04
I'm thinking if the tools don't already exist to get two dhclients to work together, then it's probably easier to just statically assign both interfaces. – Brian Jan 18 '11 at 15:09

As far as I know dhclient doesn't support this since it's not smart enough to merge configs and it's something that most people don't make use of.

Your only option is to use supercede and append but since that doesn't do what you want you're pretty much in a not resolvable scenario.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.