![]() |
James Thornton |
| Internet Business Consultant |
| Home | Blog | Bio | Projects | Contact | Latest Blog (new site): How to Get to Genius |
|---|
|
12.2. /etc/named.confThe named.conf file is a collection of statements using nested options surrounded by opening and closing ellipse characters, { }. Administrators must be careful when editing named.conf to avoid syntactical errors as many seemingly minor errors will prevent the named service from starting.
A typical named.conf file is organized similar to the following example:
12.2.1. Common Statement TypesThe following types of statements are commonly used in /etc/named.conf: 12.2.1.1. acl StatementThe acl statement (or access control statement) defines groups of hosts which can then be permitted or denied access to the nameserver. An acl statement takes the following form:
In this statement, replace <acl-name> with the name of the access control list and replace <match-element> with a semi-colon separated list of IP addresses. Most of the time, an individual IP address or IP network notation (such as 10.0.1.0/24) is used to identify the IP addresses within the acl statement. The following access control lists are already defined as keywords to simplify configuration:
When used in conjunction with other statements (such as the options statement), acl statements can be very useful in preventing the misuse of a BIND nameserver. The following example defines two access control lists and uses an options statement to define how they are treated by the nameserver:
This example contains two access control lists, black-hats and red-hats. Hosts in the black-hats list are denied access to the nameserver, while hosts in the red-hats list are given normal access. 12.2.1.2. include StatementThe include statement allows files to be included in a named.conf. This way sensitive configuration data (such as keys) can be placed in a separate file with restrictive permissions. An include statement takes the following form:
In this statement, <file-name> is replaced with an absolute path to a file. 12.2.1.3. options StatementThe options statement defines global server configuration options and sets defaults for other statements. It can be used to specify the location of the named working directory, the types of queries allowed, and much more. The options statement takes the following form:
In this statement, the <option> directives are replaced with a valid option. The following are commonly used options:
Dozens of other options are also available, many of which rely upon one another to work properly. See the BIND 9 Administrator Reference Manual in Section 12.7.1 Installed Documentation and the man page for bind.conf for more details. 12.2.1.4. zone StatementA zone statement defines the characteristics of a zone such as the location of its configuration file and zone-specific options. This statement can be used to override the global options statements. A zone statement takes the following form:
In this statement, <zone-name> is the name of the zone, <zone-class> is the optional class of the zone, and <zone-options> is a list of options characterizing the zone. The <zone-name> attribute for the zone statement is particularly important, as it is the default value assigned for the $ORIGIN directive used within the corresponding zone file located in the /var/named/ directory. The named daemon appends the name of the zone to any non-fully qualified domain name listed in the zone file. For example, if a zone statement defines the namespace for example.com, use example.com as the <zone-name> so it is placed at the end of hostnames within the example.com zone file. For more information about zone files, see Section 12.3 Zone Files. The most common zone statement options include the following:
12.2.1.5. Sample zone StatementsMost changes to the /etc/named.conf file of a master or slave nameserver involves adding, modifying, or deleting zone statements. While these zone statements can contain many options, most nameservers require only a small subset to function efficiently. The following zone statements are very basic examples illustrating a master-slave nameserver relationship. The following is an example of a zone statement for the primary nameserver hosting example.com (192.168.0.1):
In the statement, the zone is identified as example.com, the type is set to master, and the named service is instructed to read the /var/named/example.com.zone file. It also tells named not to allow by any other hosts to update. A slave server's zone statement for example.com looks slightly different from the previous example. For a slave server, the type is set to slave and in place of the allow-update line is a directive telling named the IP address of the master server. A slave server's zone statement for example.com may look like this:
This zone statement configures named on the slave server to look for the master server at the 192.168.0.1 IP address for information about the example.com zone. The information the slave server receives from the master server is saved to the /var/named/example.com.zone file. 12.2.2. Other Statement TypesThe following is a list of lesser used statement types available within named.conf
12.2.3. Comment TagsThe following is a list of valid comment tags used within named.conf:
|
|
|||||||||||||||||||
James Thornton, jamesthornton.com>Services: Search Engine Optimization SEO |
Electric Speed: Marketing Internet |