5

I got terribly slow dns resolve inside my ubuntu when using wget or curl, apt-get,...

root@815340a37f0e:/# time curl www.google.com
...
real    0m5.132s
user    0m0.006s
sys     0m0.003s

When I do nslookup its pretty fast.

root@815340a37f0e:/# time nslookup google.com
Server:         8.8.8.8
Address:        8.8.8.8#53

Non-authoritative answer:
Name:   google.com
Address: 173.194.78.101
...
real    0m0.024s
user    0m0.010s
sys     0m0.005s
svobol13
  • 193

1 Answers1

4

We had the same problem, and we found out that our hardware showed broken behaviour with IPv6.

You could double check with curl and force IPv4 like so:

$ time curl -4 www.google.com
...
real    0m0.074s
user    0m0.011s
sys     0m0.000s

Update 1:

We had the problem with our Windows Host System (Ubuntu 14.04 is the guest). The actual solution was found on this page.

Adding options single-request-reopen to the /etc/resolvconf/resolv.conf.d/base and running sudo resolvconf -h did the trick for us.

I found another anwser on askubuntu that suggested almost the same.

rene_gr
  • 141