- 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)
Asked
Active
Viewed 2.0k times
11

Scolytus
- 434
- 3
- 7
- 22
2 Answers
18
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

ewwhite
- 197,159
- 92
- 443
- 809
-
`options rotate` helped me avoid an `unable to resolve host ... : Name or service not known` error. Thanks! – steoiatsl Sep 03 '22 at 15:07
5
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.

John Siu
- 3,667
- 2
- 17
- 23