Slow DNS lookups
Posted 11-16-2012 at 05:11 PM by serafean
Since quite some time I had been experiencing slow DNS lookups on some linux boxes. Today I finally got around to fixing it.
Symptoms : KDE fails to load google/wikipedia sometimes. firefox too, less often.
ping was the main tool in this case.
What I found was that
got an IP to ping very fast, however before anything appeared onscreen, it took up to 5 seconds. Pinging the IP address however returned immediately.
On a hunch, I tried disabling name resolution in ping.
Problem identified : reverse lookup. From there, I knew I had enabled mdns (avahi reverse lookup). A quick check on the Archlinux wiki revealed that indeed, it could be the cause of my slowdown.
From there, the fix was simple : in /etc/nsswitch.conf modify
to
Works a lot better!
Always remember : the simplest tool, used correctly, is the most powerful... Start dumb, get smart.
Symptoms : KDE fails to load google/wikipedia sometimes. firefox too, less often.
ping was the main tool in this case.
What I found was that
Code:
ping www.google.com
On a hunch, I tried disabling name resolution in ping.
Code:
ping -n www.google.com
From there, the fix was simple : in /etc/nsswitch.conf modify
Code:
hosts: files mdns4 dns
Code:
hosts: files mdns4_minimal dns mdns
Always remember : the simplest tool, used correctly, is the most powerful... Start dumb, get smart.
Total Comments 0