This information is really geared for pre-Tiger versions of OS X. In OS X 10.4 (Tiger), the BIND daemon is controlled by launchd and is pre-configured (although disabled). BIND Startup in Mac OS X 10.4 (Tiger) has more detailed information. Although outdated, this article still includes useful information.
Although OS X 10.4 (Tiger) comes with BIND 9 pre-installed, it doesn't have a Startup Item. Without a Startup Item, it can't start automatically when the system boots.
OS X Startup Items can live in one of two directories: /System/Library/StartupItems/
or /Library/StartupItems/
. Personally, I prefer /System/Library/StartupItems/
since most of the Startup Items are kept there. (It's worth noting that MySQL puts it's Startup Item in /Library/StartupItems/
, but that's the only thing there on my PowerBook G4.) In the next sequence of steps, we'll create our Startup Item directory, executable shell script, and properties list from the command line. As usual, the '$' represents the shell prompt and shouldn't be typed.
$ cd /System/Library/StartupItems
$ sudo mkdir BIND
$ sudo touch BIND
$ sudo chmod 755 BIND
$ sudo touch StartupParameters.plist
That may seem a bit quick, but all we did is 1) create our Startup Item directory, 2) created our shell script file, 3) made the shell script executable, and 4) created our properties list file.
Next, we need to put some meat in the executable shell script. You can use your favorite text editor for this. Personally, I use Vim, but I know that some folks really enjoy TextMate. Add the following text to the file we created called 'BIND'.
#!/bin/sh
. /etc/rc.common
if [ "${DNSSERVER}" = "-YES-" ]; then
ConsoleMessage "Starting BIND DNS Server"
/usr/sbin/named
fi
Finally, we need to flesh out our properties list file ('StartupParameters.plist'). Again you can use any text editor (ahem, Vim) or the PropertyListEditor that comes with the OS X Developer CD.
{
Description = "Local Caching DNS Server";
Provides = ("DNS Server");
OrderPreference = "None";
Messages =
{
start = "Starting BIND DNS Server";
stop = "Stopping BIND DNS Server";
};
}
I've made these two items available as a download if you are having trouble.
Related Reading:
[...] Creating an OS X Startup Item For BIND [...]
[...] in Mac OS X 10.4 (Tiger), it’s not ready to run right out of the box. We’ve already created our Startup Item, but now we need to cleanup a few problems in the BIND configuration before we can start running [...]
[...] Server series, it has come to my attention that a couple of my methods (specifically relating to Startup Items and starting the daemon) are outdated. Although these methods may have been acceptable in pre-Tiger [...]
Hello! Good Site! Thanks you!
[...] This link may help those of you using Tiger. [...]