Ubuntu Lucid Lynx and D-Link 2740B

Posted on May 22, 2010. Filed under: Uncategorized | Tags: , , , , , , , |

I recently got a D-Link 2740B router. The setup was quite easy and quick and everything seems to work fine… except that it takes now longer to open a web page or connect to an external host with ssh.

What happened ?

After a while, I found out that it seems that it is the hostname lookup which takes several seconds.

host http://www.google.com

in a shell, I get the following:

http://www.google.com is an alias for http://www.l.google.com.
http://www.l.google.com has address
http://www.l.google.com has address

and then after several seconds:

;; connection timed out; no servers could be reached

and then the same again after a another few seconds. In total, the host name lookup takes twenty seconds.

So I used tcpdump to check what’s going on:

19:46:33.188685 IP > 38571+ A? http://www.google.com. (32)
19:46:33.240767 IP > 38571 3/4/4 CNAME[|domain]
19:46:33.241626 IP > 33883+ AAAA? http://www.l.google.com. (34)
[5 seconds pause]
19:46:38.241720 IP > 33883+ AAAA? http://www.l.google.com. (34)
[5 seconds pause]
19:46:43.242194 IP > 46916+ MX? http://www.l.google.com. (34)
[5 seconds pause]
19:46:48.242407 IP > 46916+ MX? http://www.l.google.com. (34)

So after getting the initial response, host makes more lookups, an AAAA and an MX (mail exchanger) record lookup.
AAAA seem to be IPv6 address lookups (see e.g. http://en.wikipedia.org/wiki/IPv6). So I tried disabling IPv6
at boot time (putting the kernel parameter ipv6.disable=1 into the grub configuration as described at http://ubuntuforums.org/archive/index.php/t-1307259.html).

This did not solve the problem, host still seems to query AAAA records.

I tried editing /etc/resolv.conf manually and putting a DNS different from for example the one which the 2740B queries itself when getting DNS record requests or Google’s public DNS (see http://code.google.com/speed/public-dns/). This seemed to speed up the name server lookup !

So it looks like the 2740B does not forward the AAAA record queries to the DNS provided by the internet service provider.

Also, an upgrade to the latest router firmware did not solve the problem.

After searching the web more, I found that there is a bug report on launchpad.net (https://bugs.launchpad.net/ubuntu/lucid/+source/eglibc/+bug/417757).
Quote from the bug report:

In Karmic, DNS lookups take a very long time with some routers, because glibc's DNS resolver tries to do IPv6 (AAAA) lookups even if there are no (non-loopback) IPv6 interfaces configured. Routers which do not repond to this cause the lookup to take 20 seconds (until the IPv6 query times out).

So the 2740B is probably not the only router showing this behaviour (although the Zyxel 660HW behaves better in this respect) and I’m looking forward to seeing this problem fixed on the Ubuntu side.


Make a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

One Response to “Ubuntu Lucid Lynx and D-Link 2740B”

RSS Feed for Andre Holzner's Blog Comments RSS Feed

this post saved me, thank you so much.

Where's The Comment Form?

Liked it here?
Why not try sites on the blogroll...

%d bloggers like this: