Product SiteDocumentation Site

7.3.3. Example Zone File

Seen individually, directives and resource records can be difficult to grasp. However, when placed together in a single file, they become easier to understand.
The following example shows a very basic zone file.
$TTL 86400
@	SOA (
		2001062501 ; serial
		21600      ; refresh after 6 hours
		3600       ; retry after 1 hour
		604800     ; expire after 1 week
		86400 )    ; minimum TTL of 1 day
dns1	A
	AAAA	aaaa:bbbb::1
dns2	A
	AAAA	aaaa:bbbb::2
@	MX	10
	MX	20
mail	A
	AAAA	aaaa:bbbb::5
mail2	A
	AAAA	aaaa:bbbb::6
; This sample zone file illustrates sharing the same IP addresses for multiple services:
services	A
		AAAA	aaaa:bbbb::10
		AAAA	aaaa:bbbb::11


In this example, standard directives and SOA values are used. The authoritative nameservers are set as and, which have A records that tie them to and, respectively.
The email servers configured with the MX records point to mail and mail2 via A records. Since the mail and mail2 names do not end in a trailing period (.), the $ORIGIN domain is placed after them, expanding them to and Through the related A resource records, their IP addresses can be determined.
Services available at the standard names, such as (WWW), are pointed at the appropriate servers using a CNAME record.
This zone file would be called into service with a zone statement in the named.conf similar to the following:
zone "" IN {
	type master;
	file "";
	allow-update { none; };