[sf-lug] multiple dns lookups for one page?

Rick Moen rick at linuxmafia.com
Thu Apr 15 01:58:26 PDT 2010

Quoting Andrew E (andrewevansc at gmail.com):

> Firebug is showing me that almost every asset (images, etc) on a site that
> i'm working on does a slow slow dns lookup, totalling about 10 dns lookups
> for the one pageload. This boggles my mind. Doesn't DNS just need to be
> looked up once if everything's in the same place? 

This is just off the top of my head, but maybe it's a matter of the
software in question (Firefox?) repeatedly attempting DNS lookups over
IPv6 (against a non-IPv6-compliant nameserver), and the eventually
falling back to IPv4.

The reason this rings a bell is that it came up last November on the
SVLUG mailing list, just after Ubuntu Karmic Koala came out.  Quoting a
post of mine from then:

  Quoting Eric W. Brown (ebrown at techmart.com):

  > I think there is an open bug on this issue...
  > https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/417757

  Hi, Eric.  Meant to get back to you on that.  Yes, thank you very much
  for the Launchpad reference.  That accounts for it.

  Related coverage in Red Hat's bugzilla instance:

  Basically, Skip's Karmic Koala system was configured by default to
  attempt IPv6 DNS lookups (if and only if queried for a hostname by an
  IPv6-enabled userspace app such as his copy of Firefox).  If his
  resolver config (/etc/resolv.conf) is set to hand off outbound queries
  to a non-IPv6-capable nameserver, then the resolver waits for a long
  time for the IPv6 answer before falling back to IPv4.

  Skip's solution of switching to OpenDNS "worked" in an incidental
  fashion, in that OpenDNS is IPv6-enabled.

  One of the more informed comments on the Launchpad bug (comment #7, 
  by Jeroen Massar), made the same suggestion I did:  install and use

  If you really don't care about IPv6 and just want the issue to go away
  (at the expense of headaches when/if you later change your mind about
  IPv6), then there are various ways of turning off IPv6 DNS system-wide,
  including putting "net.ipv6.conf.all.disable_ipv6=1" into
  /etc/sysctl.conf (and doing sudo sysctl -p).

  Note:  Various people in the Launchpad thread talk about "DNS resolvers"
  inside SOHO gateway appliances, etc.  Their intended reference is to
  _recursive DNS nameservers_:  That choice of terminology is unfortunate,
  because it's easily confused with the _resolver software_, i.e., DNS
  client, that is in every TCP/IP device, and that in Linux is part of
  glibc and uses /etc/resolv.conf, /etc/nsswitch.conf, and /etc/hosts as
  configuration files.

In addition to pdns-recursor, one might mention Unbound, which like
pdns-recursor is IPv6-compliant.  More at:

More information about the sf-lug mailing list