• Fedora Slow DNS Lookups

    Now that kinks have been ironed out of my broadband connection, I am beginning to notice that DNS lookups are running very very slowly. Firefox for example seems to take 3-4 seconds to look up any name. Even one that ought to have been cached. I thought the ISPs DNS server was to blame (it certainly has had it’s share of problems in the past).

    I was wrong. dig and host both return responses very quickly. Even a completely new lookup - one that is unlikely to exists even in the ISPs cache returns in less than two seconds. Anything that’s cached is returned in less than a second and anything that’s cached locally well, that’s just 30 milliseconds - but these records still take 2-3 seconds with firefox. Could it be a problem in firefox? no - mozilla and wget also seem to have the same problem. All in all any networking applications seems to spent most of it’s time doing DNS lookups. I searched around and one suggestion was to try changing the following settings in /etc/sysctl.conf:

    net.ipv4.tcp_moderate_rcvbuf=0
    net.ipv4.tcp_default_win_scale=0

    you can get the same effect (quicker even) by using the following format instead:
    echo ‘0′ > /proc/sys/net/ipv4/tcp_window_scaling
    echo ‘0′ > /proc/sys/net/ipv4/tcp_moderate_rcvbuf

    That unfortunately didn’t have any effect. The same post suggested editing modprobe.conf to switch off ipv6

    alias net-pf-10 off
    alias ipv6 off

    I reckoned I could avoid a restart (AFAIK editing the sysctl file or the modprobe.conf file requires a restart for the settings to take effect) by using rmmod ipv6. It says the module is in use. Next I try stopping ip6table (why has it started in the first place?) two of the ipv6 dependent modules disappear but I am still not allowed to remove the ipv6 module. Next i try stopping networking still no like. So I guess, I am going to have to edit modprobe.conf after all and do a reboot yikes!

    Guess what: after the reboot -it’s still slow. Looks like I might have to install a caching name server locally.

    Saturday, September 13th, 2008 at 09:33
  • Rth
    Sunday, December 7th, 2008 at 16:12 | #1

    I have the same problem. I even updated to the latest release of Fedora (Core 10) but still the same problem. Firefox3 takes 3-5 seconds to resolve anything but dig takes milliseconds. But this wasn’t happening all the time. I *think* it started once I updated my kernel under older (Core 8) distro, but not 100% sure. But I don’t see how it could make any difference. Think about starting to use dnsmasq to see if it makes any difference.

  • Rth
    Sunday, December 7th, 2008 at 16:26 | #2

    Ok this was easy to fix and was related to Firefox3 settings.

    On Firefox open about:config and then use network.dns.disableIPv6 in filter field, set it “true” which will disable IPv6 lookups.

    Here more details:
    http://kb.mozillazine.org/Network.dns.disableIPv6

    Now my browsing is back to normal…

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
TOP