Lately I have been having problem with slow DNS lookup while browsing. You can see it when I browse, it took some time in the “looking up for youtube.com …” for example.
I googled around and tried several solutions as suggested by others.
- Using Open DNS (208.67.222.222, 208.67.220.220) and verizon? (4.2.2.1, 4.2.2.2, 4.2.2.3) as my dns server.
- Disable Apple IPv6 in System Preference -> Network -> Advanced -> Configure IPv6
- Change firefox dns preference in about:config -> network.dns.disableIPv6
All of those doesn’t seem to fix my problem. I tried the DNS Performance Test and it looks like it is ok, not too fast, but not too slow either; but even though DPT is running correctly, I still see that annoying problem.
I saw there was a suggestion on turning on local DNS server from macosxhints.
I followed it, and it works very good in my case, it fixes all my problems, and now I can browse very fast. There are several things that tripped me when I was installing this, so this is my notes for other brave enough to follow the direction.
Notes :
- on step 2 (Set up your machine to run BIND server), you have to put forwarders inside the options section. At first I thought I should put it in the end of file, but it didn’t work, I just found it out after careful examination
- You have to do step 3 (Create StartupItem for DNS). There are 2 files that have to be created there.
- on step 6, you can start the DNS right away, or you can also try to start the dns server manually first by using this command (without quote): “/usr/sbin/named -f -g” . -f & -g is to run the server in the foreground, not as a daemon. It is useful if you want to test your configuration
- There is also a software “named-checkconf” that can check if your named configuration is correct or not.
- Before switching your network settings to use the local dns, you can test it up by using nslookup like this (without quote): “nslookup yoursite.com – 127.0.0.1″. If your server is set up correctly, nslookup should return the ip address for yoursite.com
I hope this helps other who have the same problem like me.
Tags: dnsleopard osx named performance problem
Raphae Halim 6:55 pm on August 29, 2009 Permalink
Hey, thanks for your post. I wanted to improve my network performance. I found the same article but didn’t know if it would work well on Leopard. You article gave me the confidence to try it out.
Nico 9:37 am on May 27, 2010 Permalink
thnx, works like a charm, also on Snow Leopard.
TIP: If you want to do it all from Shell,(like me via ssh) enter the following commands:
sudo networksetup -setdnsservers Ethernet 127.0.0.1 208.67.222.222 208.67.220.220
change 208.67.222.222 208.67.220.220 (OpenDNS) to any dns server you like, in case of a problem with your own BIND server, you can still reach Internet.
do this for all your network connections: get the list with sudo networksetup -listallnetworkservices.
So for instance you will need to do: sudo networksetup -setdnsservers Airport 127.0.0.1 208.67.222.222 208.67.220.220
SandraMillhouse 12:41 pm on July 8, 2010 Permalink
I don't get it, where's step 6? There are 3 steps and then you mention what we have to do in step 6.
Sandra Millhouse @ Virtual servers UK