named is started at boot time by one of the startup scripts. On a Red Hat system, it is started by the /etc/rc.d/init.d/named script. The script checks that the named program and the named.conf file are available, and it then starts named. After the configuration files are created, named will restart whenever the system reboots.
Of course, it is not necessary to reboot in order to run named. You can run the named boot script from the command line. The Red Hat script accepts several arguments:
start Starts named if it is not already running.
stop Terminates the currently running named process.
restart Unconditionally terminates the running named process, and starts a new named process.
condrestart Does the same thing as restart, but only if named is currently running. If named is not running, no action is taken.
reload Uses the named management tool (rndc) to reload the DNS database files into the server. If rndc fails to reload the files, the script attempts to force a reload by sending a signal to named. (More on rndc and named signal processing later in this chapter.)
probe Uses the named management tool (rndc) to reload the DNS database files into the server. If rndc fails to reload the files, the script attempts to start named.
status Displays information about whether or not named is running.
Running boot scripts from the command line is so useful and popular that Red Hat provides a script named /sbin/service for the sole purpose of running boot scripts. The syntax of the service command is simple:
service script command where script is the name of a script in the /etc/init.d directory, and command is an argument passed to that script.
Here is an example of using the Red Hat startup script to check the status of named and then to start named running:
[root]# service named status named not running. [root]# service named start
If your Linux system does not have a named script such as the one provided by Red Hat, you can start named from the command line by typing named &. However, named is rarely started from the command line because it automatically starts at every boot, and because rndc and signal processing mean that it does not need to be stopped and started to load a new configuration. Before discussing rndc, let's look at how signals can be used to cause named to load a new configuration and to perform a number of other tasks.
Was this article helpful?