I was using a script that uses curl. Quite often curl fail.

The error is name lookup timed out

I tried to ping google.com and and other sites. Indeed dns (or whatever do the translation from domain name to IP takes a few seconds to do that.

How to make my dns server (/resolver, or what is it anyway) work faster?

How to test this without a program? How to test dns resolution time?

2 Answers 2


First examine the contents of your /etc/resolv.conf file and find the nameserver lines. Most probably, the one or two closer to the top, are not functional. Just try to ping the ip addresses of the nameservers specified. Either replace the ones which are not pingign or pinging with extreme delays or unacceptable packet loss rates. If you don't have any other name servers, push the bad name servers lower in the list. DNS lookup goes from top of this file to the bottom in that order and each one has to timeout before your query proceeds to the next one.

if your DNS servers are acquired by the DHCP, then you may need to use the graphical interface of some sort, to manually specify the name servers rather than acquiring them automatically.

  • I used cpanel and change the resolver to google resolver.
    – user4951
    Jan 23, 2013 at 3:29

I had a similar problem once, I had to add my local host to my /etc/hosts.       ComputerName localhost
::1             ComputerName localhost

This solved the slowness problem on my arch-linux install.

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.