Improve DNS lookup time under Ubuntu 11.04
A lot of people complain about weird problems with DNS resolving speed under Ubuntu while surfing the Internet - it could takes a long time to access a new site, but when it is finally loaded, further browsing on that site is good. It doesn’t depends on the browser – Firefox, Google Chrome, Opera – load pages quite slowly for the first time. Besides, your network seems to be ok – ping time is acceptable, download speed is good.
Familiar situation?
There are a lot of solutions proposed on different blogs and forums – most popular among them are disabling ipv6 both in Ubuntu and FF, using alternative DNS resolution service (like Google Publis DNS), playing with MTU parameter of your connection, etc. But unfortunately, nothing works for me.
Finally, I found a solution for this problem. It was in nsswitch.conf - system databases and name service switch configuration file.
Try the following:
Output will be like this:
It means, that first Ubuntu will check files records (like /etc/hosts), then wins, then mdns4_minimal and finally dns. These records were added by Samba, so everything what we should do is change their order to:
Reboot to apply changes.
TweetTagged as dns, ubuntu
-
http://www.unixtutorial.org/ Gleb Reys