Setting Up a Zone

The basic zone configuration is handled through a zone definition in the main DHCP configuration file (typically/etc/named.conf). Listing 27.2 includes two such definitions. One of these is for the root zone (zone "."), which tells the server how to locate the root servers, which are at the core of full recursive lookups. The second zone (zone "0.0.127.in-addr.arpa") is for reverse DNS lookups on the localhost (127.0.0.0/24) network block. These are both specialized zones and shouldn't be adjusted unless you understand their intricacies. The reverse lookup on the localhost network is much like any other reverse lookup zone, though, as described in the upcoming section, "Handling Reverse Lookups."

A typical zone definition looks like this:

zone "threeroomco.com" {

type master;

file "named.threeroomco.com";

This definition includes three components:

Zone Name The zone name appears between quotation marks immediately after the zone keyword. For a forward lookup zone, the zone name is the same as the domain name or subdomain name. (It's possible to configure different servers to function as name servers for different subdomains of one domain. For instance, you might use three different name servers for the threeroomco.com, room1.threeroomco.com, and room2.threeroomco.com domains.) For reverse lookup zones, the zone name is the network portion of the subnet's IP address in reverse order followed by .in-addr.arpa. For instance, the zone name for the 172.27.15.0/24 subnet is 15.27.172.in-addr.arpa.

Server Type The type line specifies whether or not the server is the absolute final authority for the domain. This chapter describes setting up a master server (zone master), which holds the original and fully authoritative files for a zone. It's also possible to run a slave server (zone slave), which retrieves its configuration files from the domain's master or from another slave. To configure a slave, you must include a masters line within the zone definition, such as masters { 172.27.15.2; };. This line tells the slave what computer holds the master files. You may also need to include an allow-transfer block on the master system to specify what servers can request zone transfers—that is, copy domain control files. This sort of configuration can simplify running a backup DNS server, which is a requirement when you register a domain on the Internet at large. For a small subnet in a home, small business, or department of a larger business, running multiple DNS servers may not be required, so using only master zones on the single DNS server is usually appropriate.

Domain Control Filename You must tell BIND where to look for the file that defines the mapping of hostnames and IP addresses for the zone. The filename you provide with the file option resides in the directory specified with the directory option in the options section. The name you use for this file is arbitrary, but it's conventionally named after the zone itself, such as named.threeroomco.com in this example. The next section of this chapter, "Configuring the Zone Control File," describes this file in more detail.

Assuming you want to run a DNS server for a single domain or subdomain, you should add a zone configuration for that domain's forward lookups. You can add a reverse zone definition at the same time, or you can put that task off so that you don't need to create the reverse zone definition file until you've gotten the forward lookups to work properly. There's little point in restarting the DNS server at this point; before it can do anything with the zones you define, you must create the zone control file.

0 0

Post a comment