Skip to content

DNS Resource Records

Each zonefile contains resource records:

|| border=1 align=center

||# Record Type ||# Description ||

|| A||IPv4 Address record ||

|| AAAA||IPv6 Address record ||

|| CNAME||Canonical Name: a name (an alias) which redirects to another a host. ||

|| MX||Mail eXchange record: includes a preference value for the mail server. ||

|| NS||Name Server ||

|| PTR||PoinTeR record: used to reverse map IP addresses to hostnames. ||

|| SOA||Start of Authority: provides the name of the zone, email address, and other data. ||

|| SRV||SeRVices record: lists the services available such as SIP, XMPP, LDAP, HTTP. This helps for discovering services. ||

|| TXT||TeXT record: any text can be provided with a name, such as an SPF record or a [DKIM record || || TXT||TeXT 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