Domain Name Server Configuration

Mail config is present in the following files:
  1. /etc/named.conf "Root" configuration file
  2. /var/named/ Zone description
Further documentation is available in the directory /usr/share/doc/packages/bind9/ on ltnb10.


The named.conf file says which files describe which domains. The file starts with a pre-amble describing some generic characteristics of the name server (options), which normally does not need to be changed.

Then follow the zone descriptions. There are several kinds of zones:


Explanations. The header is a so-called SOA ("start of authority") record.

Example:        1D IN   SOA (
                        2001022401      ; serial: date + 2 digits
                        8H              ; refresh
                        2H              ; retry
                        1W              ; expire
                        1D )            ; minimum
        1D IN   NS
        1D IN   NS  ; nameserver
        1D IN   A
        1D IN   MX      10 mailhost     ; primary mail host
        1D IN   MX      20 ; backup mail host
It defines the following items: the name of the zone. You may also put @ here, which means "the domain name, as specified in /etc/named.conf". Using an @ rather than the explicit domain name allows to write domain independant zone files, which can be used for several different domains.
1D Time-to-live (1 Day). That's basically the duration of validity of the SOA record: if a cached copy is older than one day, it must be refreshed from the origin server (here NS). This is the e-mail of the DNS admninistrator for this zone. The @ is changed to a dot (.) to conform to DNS syntax. This also means that the e-mail address itself should not contain a dot in its username part, or else it would be ambiguous. The trailing dot means that named should not implicitly append the domain (
2001021402 Serial number, used by secondary name servers and caches to detect whether the domain has changed. Conventionnally, this is the date followed by two increasing digits. Update this number whenever you update the DNS. This example refers to the second update (02) on February 14th 2001.
  2001021402 ; serial: date + 2 digits
  8H	     ; refresh
  2H	     ; retry
  1W	     ; expire
  1D )	     ; minimum
The various expire times for this zone. Items after semicolon (;) are comments
Nameservers responsible for this zone (should included this server)
1D IN A IP Address for
1D IN MX 10 mailhost
1D IN MX 20 backup-mailhost
Hosts which handle mail sent to this domain. 10 and 20 are the priority. Lowest priority is tried first. Which means that if mailhost is down, backup-mailhost will be tried.
After this header (describing the attributes of the domain itself) follow the descriptions of the (other) hosts in this domain: Example:
pollux  1D IN   A
        1D IN   MX      10 mailhost     ; primary mail host
        1D IN   MX      20 ; backup mail host
This defines an A record (IP address) for pollux (namely, and two MX records (mail distributors): mailhost and

It is also possible to define a name as an alias (CNAME) for another one; in that case, it inherits all records of its synonym: Example:
ltnb10  1D IN   CNAME   ns
Here ltnb10 is defined to be a synonym of ns. Because a CNAME inherits all attributes of its master, it does not make sense to combine it with other attributes. For example, the following definition would be erroneous:
ltnb10  1D IN   CNAME   ns
	1D IN   MX 10
A CNAME can also point to the domain itself, in that case, you can use @ to denote the empty string (equivalent to domain):
www  1D IN   CNAME   @
In a reverse zone, we find PTR records. Those are used to map back from ip addresses to hosts:
254     1D IN   PTR   
In a reverse zone, some IP addresses may actually be CNAME's pointing to another "fictive" IP address. This is done when a same IP address block is shared by two institutions:
0      1D IN   NS    
4      1D IN   CNAME           4.0
This says that: