a way to disable AAAA lookups in the resolver

Bug #80571 reported by David Gerber on 2007-01-19
This bug report is a duplicate of:  Bug #24828: IPv6 should be disabled by default. Edit Remove
This bug affects 1 person
Affects Status Importance Assigned to Milestone
glibc (Ubuntu)

Bug Description

Consider the following scenario:
- a router with wifi (netopia 3357NWG-VGx)
- an ubuntu linux laptop
- a windows laptop

The router runs, the Windows laptop has no trouble accessing the Internet but the experience on the linux laptop is painful. It's slow, very slow. It's frustrating.

After fiddling a bit the problem is the following:

zapek@bacterion:~$ telnet www.google.com 80

(and on another terminal)
zapek@bacterion:~$ sudo tcpdump -ni eth1 -s 500 udp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 500 bytes
10:49:23.597006 IP > 57104+ AAAA? www.google.com. (32)
10:49:28.592020 IP > 57104+ AAAA? www.google.com. (32)
10:49:33.592386 IP > 35778+ AAAA? www.google.com. (32)
10:49:38.592590 IP > 35778+ AAAA? www.google.com. (32)
10:49:43.592942 IP > 44009+ A? www.google.com. (32)

Ok. Now as you can see, glibc's resolver is attempting to resolve AAAA records first. The router is not answering those queries so it timeouts 4 times until it tries the A record. That takes 20 seconds.

I know the router is to blame as it should answer instead of ignoring the query but consider this:
- I heard of this problem from several friends so I'm not alone
- this is the latest firmware since a long time
- this is the router that is sent to all Swisscom (bluewin) customers in Switzerland
- a default installation of Windows XP has no problems with this

Now, what really annoys me is that I disabled the 'ipv6' module but the resolver *still* attempts to resolve AAAA records. This doesn't make sense because even if the AAAA record would resolve, my system couldn't do anything with it.

So, is it possible to have glibc be a bit smarter and actually detect if AAAA records would be needed?



First double check that you've really disabled IP6.

IMO A system wide AAAA lookups doesn't make sense and there's already
a way to disable them in lookup:
hints.ai_flags = AI_ADDRCONFIG;
getaddrinfo (...

Too bad telnet and at least gaim don't use it, but most gnome applications and firefox do.

on the other hand an easy way to disable IPV6 would be nice, sometimes it's a real problem and not only with broken router (slow or congested uplink).

Changed in glibc:
assignee: nobody → did447
status: Unconfirmed → Needs Info
David Gerber (zapek) wrote :

Yes, I double checked that ipv6 is disabled and it really is (I prevented the module from being loaded).

I know applications can perform ipv4 lookups only but most of them don't. In Firefox you need to explicitely tell to use ipv4 though about:config. Doing this on a per-app basis isn't really simple.

What about having glibc do the following:
- socket(AF_INET6, SOCK_STREAM, 0);
- if the call works, perform an AAAA lookup first
- if it doesn't, perform an A lookup

That way, if ipv6 support is removed (eg. the ipv6 module is in blacklisted in /etc/modprobe.d), only A lockups would be performed.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers