Section C.1. The named Command

The server side of DNS is run by the name server daemon, named. The syntax of the named command is:[C]

[C] Sun systems use in.named instead of named.

named [-d level] [-p port] [[-b|c] configfile] [-q -r -f -v] [-u username] 

[-g groupname] [-t path] [-w path] [configfile]

The options used on the named command line are:

-d level

Logs debugging information in the file named.run. The argument level is a number from 1 to 11. A higher level number increases the detail of the information logged, but even when level is set to 1, the named.run file grows very rapidly. Whenever you use debugging, keep an eye on the size of the named.run file and use ndc notrace or SIGUSR2 to close the file if it gets too large. Signal handling is covered in the next section.

It is not necessary to turn on debugging with the -d option to receive error messages from named. named displays error messages on the console and stores them in the messages, even if debugging is not specified. The -d option provides additional debugging information.

-p port

Defines the UDP/TCP port used by named. port is the port number used to connect to the remote name server. If the -p option is not specified, the standard port (53) is used. Since port 53 is a well-known port, changing the port number makes the name server inaccessible to standard software packages. Therefore, -p is used only for testing.

-b configfile or -c configfile

Specifies the file named uses as its configuration file. By default the configuration file is /etc/named.conf, but the -b or -c option allows the administrator to choose another configuration file. Note that using -b or -c is optional. As long as the filename used for configfile doesn't start with a dash, the -b or -c flag is not required. Any filename written on the named command line is assumed to be the configuration file, as the last item on the command line shows.

-q

Logs all incoming queries. named must be compiled with the QRYLOG option set to enable this type of logging.

-r

Turns off recursion. With this option set, the server will provide answers only for zones for which it is an authoritative server. It will not pursue the query through other servers or zones.

-f

Runs named in the foreground. Normally named is run as a background daemon.

-v

Displays the version number. The -v switch does not run named.

-u username

Sets the user ID under which the server runs after initializing. By default, named runs as root.

-g groupname

Set the group ID under which named runs after initializing. The group ID defaults to the master group of the user ID under which named is run.

-t path

Defines the path to the directory named uses when running chroot.

-w path

Defines the path of named's working directory. The default is the current directory. The directory option in the configuration file overrides this setting.

C.1.1 Signal Processing

named handles the following signals:

SIGHUP

Causes named to reread the named.conf file and reload the name server database. named then continues to run with the new configuration. If named is compiled with the FORCED_RELOAD option, this signal forces a slave server to transfer the zone from its master server. This signal has the same effect as ndc reload.

SIGINT

Causes named to dump its cache to named_dump.db. The dump file contains all of the domain information that the local name server knows. The file begins with the root servers and marks off every domain under the root that the local server knows anything about. If you examine this file, you'll see that it shows a complete picture of the information the server has learned. This signal has the same effect as ndc dumpdb.

SIGUSR1

Turns on debugging; each subsequent SIGUSR1 signal increases the level of debugging. Debugging information is written to named.run just as it is when the -d option is used on the named command line. Debugging does not have to be enabled with the -d option for the SIGUSR1 signal to work. SIGUSR1 allows debugging to be turned on when a problem is suspected, without stopping named and restarting it with the -d option. This signal has the same effect as ndc trace.

SIGUSR2

Turns off debugging and closes named.run. After issuing SIGUSR2, you can examine named.run or remove it if it is getting too large. This signal has the same effect as ndc notrace.

Optionally, some other signals can be handled by named. These additional signals require named to be compiled with the appropriate options to support the signals:

SIGILL

Writes statistics data to named.stats. named must be compiled with -DSTATS for this signal to work.

SIGSYS

Writes profiling data into the directory defined by the directory option in the named.conf file. named must be compiled with profiling to support this signal.

SIGTERM

Writes back the master and slave database files. This is used to save data modified by dynamic updates before the system is shut down. named must be compiled with dynamic updating enabled.

SIGWINCH

Toggles logging of all incoming queries via syslogd. named must be compiled with the QRYLOG option to support this. This signal has the same effect as ndc querylog.