The mythical resolv.conf is often used but seldom understood. You might even run in to problems like we had over at WP Engine. It is very important to be able to understand how different types of failures will affect DNS. DNS is one of those services that even small increases in latency can have drastic affects on servers and applications.
Questions you should ask yourself
- How long before a DNS query times out?
- How many times will the same DNS server be tried?
- How can I reduce the damage caused by loosing a DNS server?
Below is a Linode resolv.conf that I think has some very nice characteristics.
options timeout:1 options attempts:1 nameserver 22.214.171.124 nameserver 126.96.36.199 nameserver 188.8.131.52 nameserver 184.108.40.206 domain members.linode.com search members.linode.com
What I like about the above resolv.conf
- DNS requests will time out after one second (this might be worth cutting down).
- Each DNS server will only be tried once.
- The first DNS server is a Linode server and it will be close (low latency).
- The second DNS server is Google server (this is good because if one Linode server is down, both are probably down).
- I can be pretty sure to get a resolution in little more then 1 second, at worst.
So, find a resolv.conf configuration that fits your needs.
- Google will rate limit your DNS requests :O
- The default configuration for Linode will wipe your resolv.conf changes on DHCP lease renewal.