DNS Timeouts Linux/Mac

If your primary DNS server fails, it can leave your computer / server in quite a pickle.  Many services on servers require adequate DNS performance, and your desktop won’t browse without one.

Although DNS servers are very reliable these days, it is wise to use two at least.  But, that won’t do you much good as the OS will take up to 30 seconds before switching to the second one in the list EACH time a look up is called.  Improve this default behavior with this simple adjustment:

NOTE: As always, backup your configs of anything before making changes.  Save yourself the hassle if things do not go as planned.

cp /etc/resolv.conf /etc/resolv.conf.org

Then, your favorite editor, open and edit the file:

/etc/resolv.conf

Ensure you have at least 2 DNS servers listed, then add this text on it’s own line:

options timeout:1

Snippet from the main page:

http://www.kernel.org/doc/man-pages/online/pages/man5/resolver.5.html

timeout:n
                     sets the amount of time the resolver will wait for a response
                     from a remote name server before retrying the query via a
                     different name server.  Measured in seconds, the default is
                     RES_TIMEOUT (currently 5, see <resolv.h>).  The value for this
                     option is silently capped to 30.

Keywords: Timeout, Primary, Domain Name Servers
  • 1 Users Found This Useful
這篇文章有幫助嗎?

相關文章

Clear Cache on My Mac

If you need to clear your dns cache on your Mac OS x 10.5 or greater, just issue the command via...

Site Preview Prior to Updating

Senario:You have a live site elsewhere that you are moving to M3 (thanks!), but want to see how...

Name Servers

When registering domains for your M3server account, please use the following DNS servers for your...