I have an Ubuntu 12.04 server and the DNS looksups appear to be extremely slow. time curl www.google.com
takes 40 seconds and time curl 173.194.74.147
takes 70ms. I reinstalled another dedicated server with Ubuntu 12.04 and it has the same problem too.
Question: I have been asked to check my DNS configuration. So I added google's DNS servers but I am still getting slow DNS resolves. What else should I check for?
/etc/resolve/conf
nameserver 127.0.0.1
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 213.186.33.99
search ovh.net
Best Answer
I just had this problem. I'm not sure about your case, but for me, it was a IPv6 network problem:
I had to stop
wget
using Ctrl+C after 1.5 minutes. Note the2607:f8b0:4005:800::100e
indicates an IPv6 lookup. I added the following lines to/etc/sysctl.conf
:And then refreshed those settings via:
sudo sysctl -p
Source: http://www.noobslab.com/2012/05/disable-ipv6-if-your-internet-is.htmlOnce I did that, things started working:
Note: you can just run
wget google.com
but it will save a file in your current location.-O /dev/null
will suppress that.