Menu Close

12.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 
@	IN	SOA (
			2001062501 ; serial                     
			21600      ; refresh after 6 hours                     
			3600       ; retry after 1 hour                     
			604800     ; expire after 1 week                     
			86400 )    ; minimum TTL of 1 day  
	IN	NS       
	IN	NS        
	IN	MX	10       
	IN	MX	20        

dns1	IN	A
dns2	IN	A	

server1	IN	A        
server2	IN	A

ftp	IN	A
mail	IN	CNAME	server1
mail2	IN	CNAME	server2

www	IN	CNAME	server1
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 server1 and server2 via CNAME records. Since the server1 and server2 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.
FTP and Web services, available at the standard and names, are pointed at the appropriate servers using CNAME records.