order of nameservers in resolv.conf

  • In which oder are the nameservers stated in resolv.conf used for name resolution?
  • Is there a way to influence this order?
  • Is this behavior distribution dependent? (I'm using Debian Squeeze)

You have a few options on Linux systems...

By default, the nameservers are used in listed order with a 5-second timeout before moving to the next entry.

  • In addition, you can set the options rotate parameter to query the DNS servers in a round-robin manner.
  • You can also lower the default timeout of 5 seconds to 1 second using options timeout:1.

Also see: http://linux.die.net/man/5/resolv.conf


According to recolv.conf man page, they are used in the order listed in the file.

To change the order they are being used, change the order listed in your resolv.conf.

It is NOT distribution dependent.