Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 1 down vote accepted

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.

Hope this helps

share|improve this answer
I used cpanel and change the resolver to google resolver. – Jim Thio Jan 23 '13 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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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