[Cialug] Inconsistent consistently long DNS lookup times

Colin Burnett cmlburnett at gmail.com
Sun Mar 7 22:42:15 CST 2010


This issue is kind of hairy.  HTTP in Firefox and Seamonkey; FTP via
ncftp; and NTP via ntpdate all experience a 6-second lag if I use a
domain name, but do not experience a lag if I use an IP.  My
Python-based Amazon web service app also experiences this lag (which
increased it's run time from about 15 min to over an hour).  However,
if I use links or links2 I get no lag for both domain name and IP.

Pulling out the strace I see this in every app (that's easily
strace'd) where there is lag:

socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 3
connect(3, {sa_family=AF_INET, sin_port=htons(53),
sin_addr=inet_addr("205.171.3.65")}, 28) = 0
gettimeofday({1268021564, 84586}, NULL) = 0
poll([{fd=3, events=POLLOUT}], 1, 0)    = 1 ([{fd=3, revents=POLLOUT}])
sendto(3, "\301\371\1\0\0\1\0\0\0\0\0\0\3www\6google\3com\0\0\1\0\1",
32, MSG_NOSIGNAL, NULL, 0) = 32
poll([{fd=3, events=POLLIN|POLLOUT}], 1, 5000) = 1 ([{fd=3, revents=POLLOUT}])
sendto(3, "\17\377\1\0\0\1\0\0\0\0\0\0\3www\6google\3com\0\0\34\0\1",
32, MSG_NOSIGNAL, NULL, 0) = 32
gettimeofday({1268021564, 84811}, NULL) = 0
poll([{fd=3, events=POLLIN}], 1, 4999)  = 1 ([{fd=3, revents=POLLIN}])
ioctl(3, FIONREAD, [148])               = 0
recvfrom(3, "\301\371\201\200\0\1\0\7\0\0\0\0\3www\6google\3com\0\0\1\0\1"...,
2048, 0, {sa_family=AF_INET, sin_port=htons(53),
sin_addr=inet_addr("205.171.3.65")}, [16]) = 148
gettimeofday({1268021564, 125360}, NULL) = 0
poll([{fd=3, events=POLLIN}], 1, 4959)  = 0 (Timeout)


The DNS server 205.171.3.65 is the IP address I get from Qwest.  I've
tried this with the secondary 205.171.2.65 as well as the Google DNS
of 8.8.8.8 and 8.8.4.4.  All experience a 5-6-ish second delay before
the poll() reaches its timeout (apparently 4959 ms in this instance).
All use UDP 53 to the same server.

Putting an strace -f on links yields a similar polling of the same DNS
server but it doesn't time out.  It seems to only take about 1/4 ms to
resolve though (would seem to indicate it's cached somewhere).


The problem is blatantly that the poll time's out when doing a resolve
and I don't know how the resolving differs between
Firefox/Seamonkey/ntpdate/ncftp and ping/links/links2, but it clearly
is.

My setup is gentoo box behind an Actiontec (yippy!) modem on a 7MB
Qwest DSL connection.  Lookup performance on my Win XP laptop would
seem to indicate that it's not the internet connection since Firefox
on it has no problems.  This has been going on for a couple weeks
(yes, and I'm just now getting tired of it) and I do not recall or
know of any recent changes to anything.  I've done random package
updates including a jump from KDE 4.3.3 to 4.3.5, but this happened
before that.

Otherwise, I have little complaint internet-wise.

I would be happy to provide more information but I'm not entirely
should what is appropriate and I could easily flood this with
thousands of lines of strace.  :)  Where do I go from here?!


Colin Burnett


More information about the Cialug mailing list