how to start named at boot?

henksmets

Registered
Hi, simple question:

How can a let my DNS server start at boot?

Should I start named and put it in some RC file?

thanks in advance, Henk
 
first, add a line to /etc/hostconfig that looks like this:
Code:
NAMESERVER=-YES-

then put this executable script at /Library/StartupItems/Named/Named

Code:
#!/bin/sh


# ---------------------------------------------------------------------
#  Include system wide configuration options
# ---------------------------------------------------------------------
. /etc/rc.common


# ---------------------------------------------------------------------
#  Start named
# ---------------------------------------------------------------------
if [ "${NAMESERVER:=-NO-}" = "-YES-" ]; then

        ConsoleMessage "Starting named"

        /usr/local/bin/named &

fi

you will want to use the path to named on your system there. this is also the place to put some command line options.

there should also be a /Library/StartupItems/Named/StartupParameters.plist. it should look something like this:

Code:
{
  Description   = "named dns server";
  Provides      = ("DNS");
  Requires      = ("Network");
  Preference    = "None";
  Messages =
  {
    start = "Starting named";
    stop  = "Stopping named";
  };
}

compare with other startup files located in /System/Library/StartupItems to see what options you can specify. basically, you can give information to help the system decide what order to start things in.
 
thanks very much for the complete explanation and quick response, alas it didn't worked, maybe I didn't edited the files correctly, but that doesn't matter anymore because I found a much easier way, stupid of me not to think about this first, sorry.

When you start up DNS in SERVER ADMIN it automaticaly starts the server when rebooting!!

I learned the following things while editing the files:

the path to named on Mac OS X server (10.1.5) is /usr/sbin/named
(here you can manually start named, the DNS daemon)

/Library is the correct place to put all your own startup items and is the third place that Apple intend the system to look at startup. The order is:
System/Library/StartupItems
/Network/Library/StartupItems (not yet implemented)
/Library/StartupItems

(http://discussions.info.apple.com/WebX?13@203.IwxEaIt3cZP^5@.2cd6dc6a/4)

a complete guide to customizing your boot procedure:
http://developer.apple.com/techpubs...ew/BootingLogin/Customization_Techniques.html
 
Back
Top