Objective 2: Create and Maintain DNS Zones

DNS zone files are used to resolve domain names to the domain's assigned IP addresses. These files, by default, are found under the /var/named directory and are typically named db.domain.com or domain.com.db. In these examples, we will use db.example.com. The following is a sample forward DNS file for a master (primary) record:

@          IN      SOA     ns.example.com.  root.example.com. (
                             1999080101     ; serial
                             10800  ; refresh (3 hours)
                             3600   ; retry (1 hour)
                             604800 ; expire (7 days)
                             86400 ) ; minimum (1 day)

           IN       NS             ns1.example.com.
           IN       NS             ns2.example.com.

           IN       MX             0     mail.example.com.
           IN       A              192.168.0.212
localhost  IN       A              127.0.0.1
www        IN       A              192.168.0.212
ns1        IN       A              192.168.0.10
ns2        IN       A              192.168.0.11
ftp        IN       CNAME          www
mail       IN       CNAME          www
irc        IN       CNAME          irc.example.net.

The first section is the SOA (start of a zone authority) entry. The SOA entry contains the domain of the originating host, the domain address of the maintainer, the file serial number, and various time parameters (refresh, retry, expire, and minimum time to live).

The second section of the preceding sample /var/named/db.example.com specifies the domain's primary and secondary DNS servers. These are denoted by the NS tokens. The first NS entry is the primary DNS server, and the second NS entry specifies the secondary DNS server. You can also add tertiary and further DNS servers with the same NS entries.

The third section includes other references, options, and settings for the domain entry. The A tokens ...

Get LPI Linux Certification in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.