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

According to the documentation for interface configuration files in RHEL 6, an interface can specify which name server it would like to use by including the directive DNS{1,2}=address . The documentation states,

where address is a name server address to be placed in /etc/resolv.conf if the PEERDNS directive is set to yes

Let's say I define this line for two different interfaces. Which one will appear in resolv.conf? Each time a different interface is used, will resolv.conf be overwritten once again?

In general, in the circumstance of multiple interfaces, is there a good resource to determine which name server will be used by which interface?


share|improve this question
up vote 3 down vote accepted

The network interface is not used to determine which name server to query. (It can't be done anyway, because you don't know which interface is going to be used until you know the IP.)

If you specify DNS entries for multiple interfaces they will all appear in resolv.conf, probably in the order in which the interfaces were brought up. By default name servers are queried in order, unless you've set options rotate in resolv.conf.

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.