Anyone who has 'switched' to the Mac, or has experience on a PC, knows that the PC makes the Mac look like a dog when it comes to web browsing. This is true for all browsers on the Mac. It turns out this has less to do with the end-user applications and really centers around DNS (Domain Name Server) lookups. The major bottleneck in our systems seems to be initial contact with the websites. We are having to make every single request to an external DNS server, thus creating a lag in initial response. Considering OS X is UNIX, this is completely unnecessary. We have a perfectly good DNS server (BIND) that is turned off by default.
In order to drastically improve web browsing experience, we will enable a local caching name server. This will require sudo privileges and comfort in the Terminal. We will be using the command-line text editor pico here, as TextEdit will not execute properly as root.
[robg adds: I haven't tested this hint ... and it does require a high level of comfort in the Terminal. Consider yourselves forewarned...]
A few things to remember before we start...
# rndc-confgen > /etc/rndc.conf
/* creates rndc.conf and generates key */
# head -n 6 /etc/rndc.conf > /etc/rndc.key
/* parses the key into the proper file */
# pico -w /etc/named.conf
/* opens the BIND configuration file for editing in the text editor */
Add the following into the options section, where x.x.x.x represents the IP addresses of either your ISP, or other DNS servers, known to you (Google for DNS servers if you don't know of any):
forwarders {
x.x.x.x;
x.x.x.x;
};
Save the file and quit the editor. Hit Control-O, Enter, then Control-X.# cd /System/Library/StartupItems
# mkdir BIND
# cd BIND
# touch BIND; pico -w BIND
/* Create first of two files, then open it in text editor */
Copy the following into the file, save it, and exit:
#!/bin/sh
. /etc/rc.common
if [ "${DNSSERVER}" = "-YES-" ]; then
ConsoleMessage "Starting BIND DNS Server"
/usr/sbin/named
fi
$ touch StartupParameters.plist; pico -w StartupParameters.plist
/* Create and open second of two files needed */
Copy the following into the file,save it, and exit:
{
Description = "Local Caching DNS Server";
Provides = ("DNS Server");
OrderPreference = "None";
Messages =
{
start = "Starting BIND DNS Server";
stop = "Stopping BIND DNS Server";
};
}
$ chmod +x BIND
/* Make the script executable so it can actually be run */
# pico -w /etc/hostconfig
/* Open the file OS X reads to start services */
Change it to make DNSSERVER=-YES-. Here Tiger users will have to add this value; Panther users will simply change it to -YES-. Save the file and exit.# exit
/* End root shell */
$ sudo /System/Library/StartupItems/BIND/BIND
Mac OS X Hints
http://hints.macworld.com/article.php?story=20050420025219402