Fedora Slow DNS Lookups

2008 Sept 13 at 04:03 » Tagged as :web 0.8, video,

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:



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.