Welcome to the most active Linux Forum on the web.
Go Back > Blogs > serafean
User Name


Rate this Entry

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.
ping -n
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
hosts: files mdns4 dns
hosts: files mdns4_minimal dns mdns
Works a lot better!

Always remember : the simplest tool, used correctly, is the most powerful... Start dumb, get smart.
Posted in Random fixes
Views 514 Comments 0
« Prev     Main     Next »
Total Comments 0




All times are GMT -5. The time now is 12:55 PM.

Main Menu

Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration