[Bug 94940] Re: mdns listed in nsswitch.conf causes excessive time for dns lookups

Dave Gordon 94940 at bugs.launchpad.net
Mon Sep 5 15:12:24 UTC 2011


My network was showing this (multiple) 5-second timeout problem. To test it, I turned off DNS caching
# /etc/init.d/nscd stop
and then
# time curl -I www.google.co.uk
which consistently took more than 5 seconds.
I tried several of the approaches described above, and eventually determined that the problem was primarily down to the modem/router that I was using; its internal DNS could not handle two concurrent UDP DNS enquiries. In addition, if I sent out the two UDP DNS queries (A and AAA) in parallel to an *external* DNS server, the router often dropped one of the incoming reply packets, presumably because its stateful firewall only recorded sending a packet, not how many had been sent, and so cleared the entry for the DNS server when the first reply arrived.
In the end I settled on this in /etc/nsswitch.conf:

hosts:          files nis mdns4_minimal dns [NOTFOUND=return] mdns4

(I use NIS, but not mdns - but I've left it in there in case a friend brings a machine that uses it).
But more importantly, I put this in /etc/resolv.conf:

options single-request
nameserver  213.120.234.2
nameserver 192.168.1.1

where  213.120.234.2 is one of my ISP's public DNS servers, and
192.168.1.1 is my own router as a fallback. With this configuration, the
curl command above completes in well under one second. So in this case
at least, the problem is not mdns but the limited capabilities of the
ADSL router. I think I'll switch over to running a proper DNS (and DHCP)
service on one of my own machines now, rather than relying on the
router!

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to avahi in Ubuntu.
https://bugs.launchpad.net/bugs/94940

Title:
  mdns listed in nsswitch.conf causes excessive time  for dns lookups

Status in “avahi” package in Ubuntu:
  Confirmed
Status in “nss-mdns” package in Ubuntu:
  New
Status in “nss-mdns” package in Debian:
  New

Bug description:
  Binary package hint: avahi-daemon

  I encountered this problem on a machine that is integrated into our
  work network. I performed a dist-upgrade to Feisty on my desktop and
  all went well. I've noticed recently that any dns based work seemed to
  take a significantly longer time then normal.

  My system is getting dns information on our company internal systems
  from two dns servers. Previously, if I tried to establish an ssh
  connection with another system I could generally expect the connection
  in under 3 secs.

  After the dist-upgrade the time went from under 3 seconds to
  approximately 25 seconds. After searching around the system I found an
  entry in /etc/nsswitch.conf that cause me a little concern. The line
  in question is:

     hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4

  I looked around a bit and it seems that the references to mdns are
  really talking about communication with the Avahi mDNS/DNS-SD daemon.
  Since this looks to be a part of a zeroconf configuration I wasn't
  expecting too much in my current environment, as we really only have
  three Mac's.

  What concerned me is the idea that if we hit files with no answer
  there is a delay while we hit the other options until we hit dns,
  which is where the information I seek existed.

  For an experiment I tried two separate tests. The first changed the
  line to looks like:

      hosts:          files dns mdns4_minimal [NOTFOUND=return] mdns

  The change should have improved the time, but I was still looking at
  approximately 23 seconds to return a command prompt on the destination
  machine.

  Finally, I change the entry to simply:

      hosts:          files dns

  After this change I was again receiving the destination command prompt
  in under 3 seconds. I don't know if simply changing the file will
  correct the problem long-term or not. Seems to help me, but might be
  the way to go for most Ubuntu users.

  ProblemType: Bug
  Architecture: i386
  Date: Thu Mar 22 18:10:54 2007
  DistroRelease: Ubuntu 7.04
  Uname: Linux samdesk 2.6.20-12-generic #2 SMP Wed Mar 21 20:55:46 UTC 2007 i686 GNU/Linux

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/avahi/+bug/94940/+subscriptions




More information about the foundations-bugs mailing list