Datasheet

“main” (Installation and Administration) 2004/6/25 13:29 page 464 #490
i
i
i
i
i
i
i
i
21.7.6 Structure of Zone Files
Two types of zone files are needed. One assigns IP addresses to host names
and the other does the reverse supplies a host name for an IP address.
Note
Using the Dot in Zone Files
The . has an important meaning in the zone files. If host names
are given without a final ., the zone is appended. Complete
host names specified with a full domain name must end with
a . to avoid having the domain added to it again. A missing or
wrongly placed dot is probably the most frequent cause of name
server configuration errors.
Note
The first case to consider is the zone file world.zone, responsible for the
domain world.cosmos, shown in Example 21.15.
Example 21.15: File /var/lib/named/world.zone
1 $TTL 2D
2 world.cosmos. IN SOA gateway root.world.cosmos. (
3 2003072441 ; serial
4 1D ; refresh
5 2H ; retry
6 1W ; expiry
7 2D ) ; minimum
8
9 IN NS gateway
10 IN MX 10 sun
11
12 gateway IN A 192.168.0.1
13 IN A 192.168.1.1
14 sun IN A 192.168.0.2
15 moon IN A 192.168.0.3
16 earth IN A 192.168.1.2
17 mars IN A 192.168.1.3
18 www IN CNAME moon
Line 1: $TTL defines the default time to live that should apply to all the
entries in this file. In this example, entries are valid for a period of
two days (2 D).
464 21.7. DNS — Domain Name System