Dns /

DNS Resource Records

Each zonefile contains resource records:

Record TypeDescription
AIPv4 Address record
AAAAIPv6 Address record
CNAMECanonical Name: a name (an alias) which redirects to another a host.
MXMail eXchange record: includes a preference value for the mail server.
NSName Server
PTRPoinTeR record: used to reverse map IP addresses to hostnames.
SOAStart of Authority: provides the name of the zone, email address, and other data.
SRVSeRVices record: lists the services available such as SIP, XMPP, LDAP, HTTP. This helps for discovering services.
TXTTeXT record: any text can be provided with a name, such as an SPF record or a DKIM record

Creating DNS records

Each record in the zone file is written in this format:

Name TTL Class Type Data

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