Chapter 17. Berkeley Internet Name Domain (BIND) 227
17.2.1.1. Sample Zone Statements
Most changes to the /etc/named.conf file of a master or slave nameserver concerns adding, mod-
ifying, or deleting zone statements. While these zone statements can contain many options, most
nameservers use few of them. The following zone statements are very basic examples that may be
used in a master-slave nameserver relationship.
A zone statement on a primary nameserver hosting the domain domain.com may look like Figure
17-5.
zone "domain.com" IN {
type master;
file "domain.com.zone";
allow-update { none; };
};
Figure 17-5. Example of a simple master zone statement
This zone statement names the zone domain.com, sets the type as master, tells named to read the
/var/named/domain.com.zone file to configure the zone, and to allow no updates by any other
hosts.
A slave server’s zone statement for domain.com might look like Figure 17-6.
zone "domain.com" {
type slave;
file "domain.com.zone";
masters { 192.168.0.1; };
};
Figure 17-6. Example of a simple slave zone statement
This zone statement tells named on the slave server to look to the 192.168.0.1 master server to find
out the configuration information for the zone called domain.com. The information the slave server
receives from the master server is saved in the /var/named/domain.com.zone file.
17.2.2. Zone Files
Zone files, which contain information about a particular namespace, are stored in the named working
directory. By default, this is /var/named. Each zone file is named according to the file option data
in the zone statement, usually in a way that relates to the domain in question and identifies the file as
containing zone data, such as example.com.zone.
Each zone file may contain directives and resource records. Directives tell the nameserver to do a
certain thing or apply a special setting to the zone. Resource records define the parameters of the
zone, assigning an identity within the zone’s namespace to particular systems. Directives are optional,
but resource records are required to provide nameservice to that zone. All directives and resource
records should go on their own lines.
Comments can be placed after semicolon characters (;) in zone files.
Commenti su questo manuale