DNS Performance

I've been seeing slow web page loads. I've tracked it down to DNS. Many pages now include an enormous number of objects, often from many sites. Thus performance of hostname lookups is critical. By default OS X is configured to send every hostname lookup to whatever DNS server you have configured. Depending upon the response speed of that server and its location, this can slow you down. In my situation queries went to my ISP. Their DNS servers seem fairly slow. I could speed things a bit by using a server at Rutgers (where I work). But the right solution is to run named on the system as a caching server. Then you configure your DNS servers to list 127.0.0.1 first. (In networking, choose the TCP/IP tab. In DNS server, list 127.0.0.1 first.)

Setting up named requires editing /etc/named.conf and /etc/hostconfig. In /etc/hostconfig, you add a line

DNSSERVER=-YES-

at the end. In /etc/named.conf
* comment out the two lines involving rndc.key, by putting // at the beginning of the line
* in the options section, if you have a name server you trust, I recommend adding

forward first;
forwarders { a.b.c.d; };

where a.b.c.d is the IP address of that server. You don't need this. If you don't supply it, your system will go directly to the official servers. But typically you'll get somewhat better performanc and lessen the load on the official server.
* in the controls section, there's a line
inet 127.0.0.1 port 54 allow {any;}
It should be
inet 127.0.0.1 port 54 allow {any;};

Test it by doing /usr/sbin/named -g. Make sure it starts up properly. If there's a problem with the file it should tell you at least what line it's on. Once named starts properly, reboot to get it started automatically. It's normal in the configuration I have given to get complaints about keys.

Debugging aids:
* ps agx | grep named should show named running
* sudo /usr/sbin/named -g will start named with debugging
* /Library/Logs/named.log is the log file
* sudo killall -HUP named will cause named to reread /etc/named.conf
* sudo tcpdump port 53 will show all DNS queries


G4 MDD dual 1 GHz, Macbook Pro 2 GHz Mac OS X (10.4.6)

Posted on May 20, 2006 9:12 AM

Reply
3 replies

May 20, 2006 10:34 AM in response to Charles Hedrick1


• in the options section, if you have a name server
you trust, I recommend adding

forward first;
forwarders { a.b.c.d; };



When I include these lines named complains about them:
<hr>May 20 10:30:54.923 /private/etc/named.conf:62: unknown option 'forward'
May 20 10:30:54.923 /private/etc/named.conf:63: unknown option 'forwarders'
May 20 10:30:54.923 loading configuration: failure
May 20 10:30:54.923 exiting (due to fatal error)
<hr>


RRS

iMac 20" Core Duo, 2 GB; MacBook Pro 15" 2.0 GHz, 2 GB Mac OS X (10.4.6)

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

DNS Performance

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.