Online Book Reader

Home Category

UNIX System Administration Handbook - Evi Nemeth [272]

By Root 2816 0
permissions. The syntax of the $INCLUDE directive is

$INCLUDE filename

The specified file is read into the database at the point of the $INCLUDE directive.

The $TTL directive sets a default value for the time-to-live field of the records that follow it. Previously, the only way to set the default was in the SOA record (described on page 438). BIND 8 likes to have a $TTL at the beginning of zone files; BIND 9 requires it and refuses to load zone files that do not set a default $TTL.

BIND 9 enforces a concept known as TTL harmonization; it forces all records in an RRset (that is, all records of the same type that pertain to a single node) to have the same TTL. The value that’s actually used is that of the first resource record for the node/type pair.

$GENERATE, a relatively new BIND 8 construct, provides a simple way to generate a series of similar records. It serves mostly to help with generating RFC2317-style classless in-addr.arpa mappings (the CNAME hack for reverse zone files), for cases in which the boundaries of administrative authority do not match the boundaries of bytes in an IP address.

The format of the $GENERATE directive is

$GENERATE start-stop/[step] lhs type rhs [comment]

and the generated lines are of the form

lhs type rhs

The start and stop fields specify the range of values for a single numeric iterator. One line is generated for each value in the interval. The iterator value is incorporated into lhs and rhs with the $ character. If you also specify a step, the iteration is by step-size increments. type is the record type. Currently, only CNAME, PTR, and NS are supported, and only in BIND 8. BIND 9 might support this construct in later releases. See page 447 for an example.

The localhost zone

The address 127.0.0.1 refers to a host itself and should always be mapped to the name “localhost.localdomain.”, for example, localhost.cs.colorado.edu. Some sites map the address to just plain “localhost.” as though it were part of the root domain; this configuration is incorrect.

If you forget to configure the localhost zone, your site may end up querying the root servers for localhost information. The root servers are currently receiving so many of these queries that the operators are considering adding a generic mapping between localhost and 127.0.0.1 at the root level.

See page 480 for an example of a complete and correct localhost configuration.

Glue records: links between zones

Each zone stands alone with its own set of data files, name servers, and clients. But zones need to be connected together to form a coherent hierarchy: cs.colorado.edu is a part of colorado.edu, and we need some DNS linkage between them.

Since DNS referrals occur only from parent domains to child domains, it is not necessary for a name server to know anything about the domains (or more accurately, zones) above it in the DNS hierarchy. However, the servers of a parent domain must know the IP addresses of the name servers for all of its subdomains. In fact, only the name servers known to the parent zone can be returned as referrals in response to external queries.

In DNS terms, the parent zone needs to contain the NS records for each delegated zone. Since NS records are written in terms of hostnames rather than IP addresses, the parent server must also have a way to resolve the hostnames, either by making a normal DNS query (if this does not create a dependency loop) or by having copies of the appropriate A records.

There are two ways to meet this requirement: by including the necessary records or by using stub zones.

With the first method, you can simply include the necessary NS and A records in the parent zone. For example, the colorado.edu zone file could contain these records:

; subdomain information

cs IN NS ns.cs.colorado.edu.

IN NS piper.cs.colorado.edu.

IN NS ns.xor.com.

ee IN NS ns.ee.colorado.edu.

IN NS ns.cs.colorado.edu.

; glue records

ns.cs IN A 128.138.243.151

piper.cs IN A 128.138.204.4

ns.ee IN A 128.138.200.1

The “foreign” A records are called glue records

Return Main Page Previous Page Next Page

®Online Book Reader