Zone file

From Wikipedia, the free encyclopedia

In computer networking, a zone file is a database element of the domain name system (DNS) used by BIND and other DNS server software. A zone file typically contains information that defines mappings between domain names and IP addresses and can also contain reverse mappings which can resolve IP addresses into domain names. A zone corresponds roughly to a domain name (including top-level domains and subdomains). The format of the zone file is defined in RFC 1035 as well as the documentation for BIND.

A simple example of a zone file is below:

$TTL 1h     ; Name lookups should be re-checked after 1 hour 
; nameserver, the email address for technical contact:
example.com.  IN  SOA  ns.example.com. username.example.com ( 
    2007120710 ; serial number of this zone file
    1d        ; slave refresh (1 day)
    1d        ; slave retry time in case of a problem (1 day)
    4w        ; slave expiration time (4 weeks)
    1h        ; minimum caching time in case of failed lookups (1 hour)
  )
example.com.  NS    ns                    ; ns.example.com is the nameserver for example.com
example.com.  NS    ns.somewhere.com.     ; ns.somewhere.com is a backup nameserver for example.com
example.com.  MX    10 mail.example.com.  ; mail.example.com is the mailserver for example.com
example.com.  A     10.0.0.1              ; ip address for "example.com"
ns            A     10.0.0.2              ; ip address for "ns.example.com"
www           CNAME ns                    ; "www.example.com" is an alias for "ns.example.com"
wwwtest       CNAME www                   ; "wwwtest.example.com" is another alias for "www.example.com"

As a minimum, the zone file specifies the "time to live" (TTL) of a nameserver lookup, the name of the nameserver for the zone, the contact email address for this zone file, and some information for slave servers, that is, other nameservers that may keep a backup copy of the zone information in case the main nameserver is not reachable. The email address has the @ symbol replaced by a period (.). In the zone file, host names that do not end in a period are assumed to be relative to the zone. For example, in the example above, "www" refers to "www.example.com", but "example.com." does not refer to "example.com.example.com", but rather to "example.com".

A zone file is referenced by the configuration file of the nameserver software such as bind, typically by a statement such as below:

zone "example.com" {
   type master;
   file "/var/named/db.example.com"; 
};

[edit] References

[edit] See also

Languages