In order to fix a problem with DNS resolution in a particular customer environment, their admin has suggested adding options timeout:0 to the /etc/resolv.conf file on their CentOS 5 server.

The man page on the OS for resolv.conf has this to say about the timeout setting:


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>).

And I see from here that there is a silent cap of 30 seconds, but I haven't found any documentation anywhere that tells me what the effect of setting this value to 0 will be. Does anybody know?


This is actually a good idea when you have more than one nameserver set in your resolv.conf. The effect is that the resolver asks the number of nameservers without waiting and returns the first response. It should be used only when your first server in the resolv.conf is overloaded. But normally it has no effect, because the dns responses are quick.

Another good solution is to use nscd - Name service Cache Daemon.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.