Slow DNS resolution in Ubuntu
Just a quick post today. I found that dns resolution was awfully slow on my girlfriends Ubuntu Edgy laptop. Here’s a quick fix that worked for me - hopefully it’ll work for you.
Open up /etc/resolv.conf - it may look like this…
search localnet
nameserver 192.168.20.1
nameserver 212.50.12.2
nameserver 213.249.3.22
Remove the nameserver line that corresponds to your router (in my case it’s 192.18.20.1)
I haven’t got a clue why, but although the router’s dns works fine on windows, it’s dodgy on linux. Any suggestions why it might be then please leave a comment.
This entry was posted on Thursday, January 11th, 2007 at 10:18 pm and is filed under . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Post to del.icio.us
Post to Slashdot
Digg this
January 23rd, 2007 at 4:22 pm
The problem with your solution is everytimg you renew DHCP it will re-write your /etc/resolv.conf. Here is a good article I found to setup local DNS cache that has been working great for me.
http://ubuntu.wordpress.com/2006/08/02/local-dns-cache-for-faster-browsing/
January 23rd, 2007 at 8:39 pm
Thanks for the tip Ryan, I’ll give it a try
January 25th, 2007 at 4:20 pm
If you don’t want /etc/resolv.conf do be overwritten by dhcpd each time your IP is renewed just create a
/etc/dhcp3/dhclient-enter-hooks
script (+x)
with
#!/bin/sh
function make_resolv_conf {
echo “Doing nothing to resolv.conf”
}
Your resolv.conf will not be modified anymore by dhcpd.