Types of DNS Records with Examples
A record
The A record is the most common form of DNS record. An A record points a domain name to an IPv4 address.
Its primary application is IP address lookups. A web browser can load a webpage using the domain name by resolving its A record, which is how we access websites without knowing their IP addresses.
For example, you can have an A record for www.example.com that points to its hosting server's IP address, such as 93.184.216.34.
AAAA Record
AAAA records are part of the IPv6 protocol, used to point a hostname to an IPv6 address. They serve the same role as A records but store the newer IPv6 addresses instead of IPv4.
This makes them useful for any website or service reachable over IPv6, without administrators having to manage IPv4 addresses where IPv6 is in use.
AAAA records point to IPv6 addresses like: 2001:0db8:85a3:0000:0000:8a2e:0370:7334.
CNAME Record
CNAME records are used to create aliases between hostnames. For example, if your content is hosted at blog.example.com, you can publish a CNAME at www.example.com so that requests for www.example.com resolve to blog.example.com. The alias works at the hostname level only; a CNAME cannot act on a URL path such as /blog, since paths are handled at the HTTP layer rather than by DNS.
Users can create a CNAME record for www.example.net pointing to www.example.com:
www.example.net. IN CNAME www.example.com.
Nameserver (NS) Record
This record identifies the nameservers for a domain name. It is added to the zone file when you add a new domain and must be set up correctly before creating other records for that domain.
NS records tell the rest of the internet which nameservers are authoritative for resolving your domain, making them an essential part of virtually every DNS configuration.
The following is an example of an NS record:
example.com. IN NS ns1.example.com.
Mail exchange (MX) Record
An MX record specifies the mail servers responsible for accepting email for a domain. It is required if you want to receive email at your domain, and it points to a hostname that in turn resolves (via A or AAAA records) to the IP address of your mail server. MX records also carry a priority value, where a lower number is preferred.
The following is an MX record example for Google's mail servers:
example.com. IN MX 10 aspmx.l.google.com.
TXT Record
A TXT record lets you add textual information about your domain to DNS. TXT records are widely used in email security and authentication.
In email authentication, a TXT record tells receiving servers how to validate a message's source. SPF, for example, is published as a TXT record.
Example of a TXT record:
v=spf1 include:_spf.google.com ~all
SOA Record
Every zone has a Start of Authority record, which specifies the primary nameserver and the authoritative source of information for the zone, along with administrative details such as the responsible contact address and the zone's timing parameters (serial number, refresh, retry, expire, and minimum TTL).
This is an example of an SOA record for example.com:
ns1.example.com. admin.example.com. 2142133102 7840 3641 580402 300
SRV Record
A service (SRV) record specifies the location (hostname and port) of a server providing a particular service on the network.
Here is an SRV record for a SIP service:
_sip._tcp.example.com. IN SRV 5 0 5060 servername.example.com.
What is SPF? Free2 m
Video Introduction to SPF Free1 m 41 s
A Brief History of SPF Free1 m
How does SPF work? Free2 m
SPF Tags: Syntax of an SPF Record Free3 m
SPF Null Value Explained Free3 m
SPF Neutral Mechanism Explained Free4 m
How to create and publish SPF records? Free2 m
SPF Authentication Failures Free3 m
Video Explanation: SPF PermError Free1 m 39 s
Quiz 430 m
What is DMARC? Free1 m
Video Introduction to DMARC Free1 m 15 s
A Brief History of DMARC Free1 m
How does DMARC work? Free2 m
What is DMARC Policy? : None, Quarantine & Reject Free2 m
Video Explanation: DMARC Policy Free1 m 40 s
DMARC Tags Free4 m
DMARC Aggregate (RUA) Reports Free3 m
DMARC Failure (RUF) Reports Free2 m
How to Create and Publish a DMARC Record? Free3 m
DMARC Authentication Failures Free3 m
Video Explanation: Why does DMARC Fail? Free1 m 37 s
Quiz 630 m