This one is for you hacking nuts that do absolutely everything possible to optimize your OS X machine.
If you are on a broadband network, then you can slightly optimize your internet access by installing bind, the Berkeley Internet Name Domain server name server as a caching server.
Using this caching nameserver setup should give you instant dns lookups on (pretty much) any hostname that has been used by any application on your machine at any time since the last reboot. Thus, if you access ftp.xyz.com using Fetch, the nameserver will look up the hostname and store it, so that tomorrow when you access it with Internet Explorer the caching nameserver will return the lookup information instantly.
If you'd like to set this up on your machine, read the rest of the article.
[Editor's note: I have not tried this myself yet, and it's a relatively complex hint. I believe I didn't lose anything in the formatting process, but please post if you notice any errors.]
Start by downloading bind (since you won't be migrating, you might as well use the latest version, 9.2) from this link. Unpack it by typing the following:
tar -xzvpf bind-9.2.0.tar.gzThen, change directories to the bind source directory that you just unstuffed:
cd bind-9.2.0Next, su to root and type the root password ("su" then enter).
mkdir /usr/localbind uses autoconf, so that compilation is easy. Type the following:
./configure --prefix=/usr/local --mandir=/usr/local/share/manAfter several minutes, it will have configured all the appropriate files.
makeAfter about 45 minutes to an hour, the compilation will finish. All that is left to do is install. To install, type the following:
make installThis should only take a few minutes.
mkdir /usr/local/etcYou will also want to create the namedb directory at this point:
mkdir /usr/local/etc/namedbNow, we will make the named.conf file. We will add more to it later, but for
options {
directory "/usr/local/etc/namedb"; // Working directory
pid-file "named.pid"; // Put pid file in working dir
};
// Provide a reverse mapping for the loopback address 127.0.0.1
zone "0.0.127.in-addr.arpa" {
type master;
file "localhost.rev";
notify no;
};If you are not comfortable typing this file into your favorite console based text editor, then you can download a copy of this file, cd to the directory into which you've downloaded it, and move it into /usr/local/etc:mv named.conf /usr/local/etcNext, we will create the localhost.rev file. This file should look like this:
$TTL 86400If you are not comfortable typing this file into your favorite console based text editor, then you can download a copy of this file, cd to the directory into which you've downloaded it, and move it into /usr/local/etc/namedb:
; $ORIGIN 0.0.127.in-addr.arpa.
@ IN SOA localhost.localdomain. dlandrith.mac.com. (
12 ; Serial number
172800 ; Refresh every 2 days
3600 ; Retry every hour
1728000 ; Expire every 20 days
172800 ; Minimum 2 days
)
;
IN NS localhost.
;
0 IN PTR loopback-net.
1 IN PTR localhost.
mv localhost.rev /usr/local/etc/namedbNext we will create the rndc.conf file, and use it to suppliment the named.conf file. The rndc.conf file gets created automatically. You will change to the /usr/local/etc directory:
cd /usr/local/etcNext, you will use rndc-confgen to generate the configuration. Because of a bug in the openBSD random device that Darwin uses, you'll need to type a bunch of nonsense to generate a key that rndc uses to connect to bind. Issue the following command:
/usr/local/sbin/rndc-confgen > rndc.confNow just type away until the console says "stop typing."
tail -n10 rndc.conf | head -n9 | sed -e s/#\ //g >> named.confNow, you should be ready to start. First, we'll run in console mode. Type the following:
/usr/local/sbin/named -gc /usr/local/etc/named.confAfter spitting out some messages, it should end up with a line that ends simply "running."
/usr/local/sbin/rndc statusThis should end by telling you that your server is up and running.
cp -r Bind /System/Library/StartupItemsLast, change the DNS entry in the Network panel of your System Preferences to 127.0.0.1 and reboot. You can test this by simply opening your web browser. If pages come up, then it works.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20011220115956917