Server Fault is a question and answer site for system and network administrators. 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'm trying to fetch a page programatically and it takes exactly 10 seconds to resolve the host, every time. On another machine it takes exactly 30 seconds. Both Linux.

My code is in Java but the problem is reproducable using wget:

time wget -d  --header "User-Agent:Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.24 (KHTML, like Gecko) Ubuntu/10.10 Chromium/11.0.696.65 Chrome/11.0.696.65 Safari/534.24"

This hangs for 10 secs on:


We're running on Linux.

To confuse things further browsers on the same machine fetch the same page immediately.

Any clues?

share|improve this question
No idea what the problem is but my lookup timed out but worked the second time – Chopper3 May 11 '11 at 17:00
up vote 5 down vote accepted

This is because wget and lynx aren't caching the DNS results, and your browsers may even have IPv6 disabled.

The DNS for is broken, and times out on AAAA records.

You can use the -4 or --inet4-only option to wget to force IPv4 only.

$ time host -t A is an alias for has address

real    0m0.009s
user    0m0.000s
sys 0m0.000s

$ time host -t AAAA
;; connection timed out; no servers could be reached

real    0m14.008s
user    0m0.000s
sys 0m0.000s
share|improve this answer

The browsers may be caching the DNS results. It might be worth trying the query directly to the configured DNS servers to see if they are the problem -- perhaps one of them is particularly slow or down. Take the IP address from the nameserver line in /etc/resolv.conf and run

dig +trace

(replace with your DNS server's IP address)

share|improve this answer
dig returns pretty much instantly. I even have dnsmasq running, and if I don't specify the nameserver argument the response comes back from as expected, using dig. Weird. It's only when I use an http client such as wget or lynx that it slows right down... – Joel May 11 '11 at 17:04

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.