OS X Leopard DNS performance problem – enabling local name server

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.

  1. 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.
  2. Disable Apple IPv6 in System Preference -> Network -> Advanced -> Configure IPv6
  3. 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: