The options Statement

Most named.conf files open with an options statement. Only one options statement can be used. The options statement defines global parameters that affect the way BIND operates. It also sets the defaults used by other statements in the configuration file. The most commonly used options statement defines the working directory for the server:

options {

directory "/var/named"

The statement starts with the options command. The curly braces enclose a list of options, and the keyword directory defines the directory that named will read files from and write files to. The directory name is also used to complete any filename specified in the configuration file. The literal enclosed in quotes is the pathname of the directory. Notice that both the directory clause and the options statement end with a semicolon.

As you'll see in the section on the named control tool later in this chapter, named writes several different files that are used to check the status of the name server. The options statement can be used to change the default pathnames of the individual files. However, it is generally best to keep the standard name for each status file and to store these files in the directory identified by the directory command. Doing so makes things simpler for others who attempt to diagnose a name server problem on your system.

Several options can be set that affect all zones or all servers. In most cases, it is better to set those values specifically for the zone or server that is being affected. The designers of BIND have set the defaults correctly for the vast majority of zones and servers. Zones and servers that need other values are exceptions, and they should be treated as such by defining the exceptional characteristics directly on the zone or server statement—not in the options statement. You'll see examples of defining options in the zone statement in the next section.

One option used on occasion is forwarders. The forwarders option causes the local server to forward to a specific list of servers all queries that it cannot resolve from its own cache. This builds a rich cache on the selected servers. The selected servers should be on your local network because the point of building the rich cache is to reduce the number of queries sent over the wide area network. This is primarily useful if your WAN charges for usage, as some ISDN networks do.

A sample forwarders option is options {

directory "/var/name"; forward first;

The forward first option says that the local server should try the forwarders before it tries to get an answer from any other external server. This is the default, so this option really didn't need to be specified. The other possible value is forward only, which tells the server that it can talk only to the forwarders. Even if the forwarders are not responding, the local server is not allowed to find the answer itself when forwarders only is specified. The forwarders option lists the addresses of the servers to which queries are forwarded.

Was this article helpful?

0 0

Post a comment