mail us  |  mail this page

products  |  company  |  support  |  downloads  |  isp services  |  contact us

Chapter 8. DNS Resource Records

Zone File Format

The DNS system defines a number of Resource Records (RRs). The text representation of these records are stored in zone files.

Zone file example

; zone file for mydomain.com
$TTL 12h    ; default TTL for zone
@         IN      SOA   ns1.mydomain.com. root.mydomain.com. (
                        2003080800 ; se = serial number
                        3h         ; ref = refresh
                        15m        ; ret = update retry
                        3w         ; ex = expiry
                        3h         ; min = minimum
                        )
              IN      NS      ns1.mydomain.com.
              IN      MX  10  mail.anotherdomain.com.
joe           IN      A       192.168.254.3
www           IN      CNAME   joe 

The above example shows a very simple but fairly normal zone file. The following notes apply to zone files:

  1. Zone files consist of Commnents, Directives and Resource Records
  2. Comments start with ';' (semicolon) and are assumed to continue to the end of the line. Comments can occupy a whole line or part of a line as shown in the above example.
  3. Directives start with '$' and are standardized (defined in RFC 1035) - $TTL, $ORIGIN and $INCLUDE. BIND additionally provides the non-standard $GENERATE directive.
  4. There are a number of Resource Record types defined in RFC 1035 and augmented by subsequent RFCs. Resouce Records have the generic format:
    name ttl  class   rr     parameter
    
    The value of 'parameter' is defined by the record and is described for each Resource Record type in the sections below.
  5. The $TTL should be present and appear before the first Resource Record (BIND 9).
  6. The first Resource Record must be the SOA record.

DNS Generic Record Format

Resource records are always represented by textual records. The generic representation of each Resource Record is shown below:

Note: The record format shown below is as defined in the RFCs and is used internally or when transferring information across a network e.g. during a DNS XFER. Do not confuse this with the format you use to define an entry in a zone source file.

NAME TYPE CLASS TTL RDLENGTH RDATA

Where:

NAME The name of the node to which this record belongs
TYPE The resource record type which determines the value(s) of the RDATA field. Type takes one of the values below.
CLASS A 16 bit value which defines the protocol family or an instance of the protocol. The normal value is IN = Internet protocol (other values are HS and CH both historic MIT protocols).
TTL 32 bit value. The time to Live in seconds (range is 1 to x). The value zero indicates the data should not be cached.
RDLENGTH The total length of the RDATA records.
RDATA Data content of each record is defined by the TYPE and CLASS values.

DNS Record Types

The current DNS RFCs define the following Resource Record Types:

Note: There are a number of other record types which were defined over the years and are no longer actively supported these include MD, MF, MG, MINFO, MR, NULL. A full list of DNS Record Types may be obtained from IANA DNS Parameters.

RR Type Value Description
A 1 IPv4 Address record. An IP address for a host within the zone. RFC 1035.
AAAA 28 Obsolete IPv6 Address record. An IP address for a host within the zone.
A6 38 IPv6 Address record. An IP address for a host within the zone. RFC2874.
AFSDB 18 Location of AFS servers. Experimental - special apps only. RFC 1183.
CNAME 5 Canonical Name. An alias name for a host. RFC 1035.
DNAME 39 Delegation of reverse addresses. RFC2672.
HINFO 13 Host Information - optional text data about a host. RFC 1035.
ISDN 20 ISDN address. Experimental = special applications only. RFC 1183.
KEY 25 DNSSEC. Public key associated with a DNS name. RFC 2535.
LOC 29 Stores GPS data. Experimental - special apps only. RFC 1876.
MX 15 Mail Exchanger. A preference value and the host name for a mail server/exchanger that will service this zone. RFC 974 and 1035.
NS 2 Name Server. Defines the authoritative name server for the domain defined in the SOA record. May be more than 1 NS record. RFC 1035.
NXT 30 DNSSEC Next Domain record type. RFC 2535.
PTR 12 A pointer to a sub domain. RFC 1035.
RP 17 Information about responsible person. Experimental - special apps only. RFC 1183.
RT 21 Through-route binding. Experimental - special apps only. RFC 1183.
SOA 6 Start of Authority. Defines the zone name, an e-mail contact and various time and refresh values applicable to the zone. RFC 1035.
SRV 33 Information about well known network services. RFC 2782.
SIG 24 DNSSEC. Signature - contains data authenticated in a secure DNS. RFC 2535.
TXT 16 Text information associated with a name. RFC 1035.
WKS 11 Well Known Services. Experimental - special apps only (replaced with SRV). RFC 1035.
X25 19 X.25 address. Experimental - special apps only. RFC 1183.

DNS Zone File Directives

Directives start with '$' and are standardized (defined in RFC 1035) - $TTL, $ORIGIN and $INCLUDE. BIND additionally provides the non-standard $GENERATE directive.

Directive Description
$INCLUDE Includes the defined file in-line.
$ORIGIN Defines the base name (aka label) to be used for 'unqualified' name substitution.
$TTL Defines global Time-to-Live (TTL) values.

Copyright © 1994 - 2004 ZyTrax, Inc.
All rights reserved. Legal and Privacy
 
site by zytrax
web-master at zytrax
Page modified: September 14 2004.

Contents

tech info
guides home
intro
contents
1 objectives
big picture
2 concepts
3 reverse map
4 dns types
quickstart
5 bind
6 samples
reference
7 named.conf
8 dns records
operations
9 howtos
10 trouble
11 errors
programming
12 bind api's
security
13 dns security
bits & bytes
15 messages
resources
notes & tips
registration FAQ
dns resources
dns rfc's

Creative Commons License
This work is licensed under a Creative Commons License.

If you are happy it's OK - but your browser is giving a less than optimal experience on our site. You could, at no charge, upgrade to a W3C STANDARDS COMPLIANT browser such as Mozilla

Resources

Systems

FreeBSD
NetBSD
OpenBSD
DragonFlyBSD
Linux

SCO vs IBM

Linux Links
Wikipedia Links

Applications

OpenOffice
Mozilla
SourceForge
GNU-Free SW Foundation

Organisations

Open Source Initiative
Creative Commons

Misc.

Ibiblio - Library
Open Book Project
Open Directory

printer friendly

SPF Record Conformant Domain Logo

English
French
Press
What's New
ISP Services
ISP Support
Pricing
Security
NetWidget
Air-Frame
Consulting
Networks
WarpTwo
Overview
SuperNAT
Firewall
Multicasting
Diagnostics
Security
QoS
Bandwidth
Utilities
Contact Us
Background
Map
Media Center
Feedback
Open Source
Tech Info
Tech Links  
Open Guides  
All
WarpTwo
Web
CoolFig
Zing
ControlServer
WarpOne
Products  
ISP Support  
Security  
Troubleshoot  
On-Line Help  
FAQ  
Bug Reports  
Tech Info
Overview
Open Guides
Advocacy
Open FAQ
web stuff
dom stuff
css stuff
language stuff
regex stuff
rfc stuff
cable stuff
lan wiring
rs232 stuff
protocol stuff
pc stuff
wireless stuff
ascii codes
data rate stuff
telephony stuff
mechanical stuff
embedded stuff
electronic stuff