DNS Records Explained: All Record Types Guide

DNS records define how a domain behaves on the internet. This guide covers every major record type, what it does, and how to read its syntax.


DNS records are the individual instructions that tell the internet how to handle a domain. They define where a website lives, which servers handle email, which security policies apply, and much more. Understanding DNS records is fundamental to managing any domain, diagnosing problems, and configuring services correctly.

What Is a DNS Record?

A DNS record is an entry in a zone file — a text-based database stored on an authoritative nameserver. Each record has a specific type, a name, a time-to-live (TTL), and a value. When a resolver queries a domain, the authoritative nameserver returns the relevant records from its zone file.

You can inspect any domain's DNS records using the ShowDNS Check All DNS Records tool or query individual record types with the DNS Lookup tool.

DNS Record Syntax

A DNS record in a zone file follows this format:

text
NAME TTL CLASS TYPE VALUE example.com. 3600 IN A 93.184.216.34
  • NAME — the domain or subdomain the record applies to (trailing dot indicates the DNS root).
  • TTL — time-to-live in seconds; how long resolvers cache this record.
  • CLASS — almost always IN (Internet).
  • TYPE — the record type (A, MX, TXT, etc.).
  • VALUE — the record data, specific to the type.

A Record

An A record maps a domain name to an IPv4 address. It is the most fundamental DNS record — without it, a domain cannot be reached over IPv4.

text
example.com. 3600 IN A 93.184.216.34

Learn more: What Is an A Record?

AAAA Record

An AAAA record maps a domain name to an IPv6 address. As the internet transitions from IPv4 to IPv6, AAAA records are increasingly important.

text
example.com. 3600 IN AAAA 2606:2800:220:1:248:1893:25c8:1946

Learn more: What Is an AAAA Record?

CNAME Record

A CNAME (Canonical Name) record creates an alias from one domain name to another. It does not point directly to an IP address — instead, it redirects the resolver to look up the target domain's records.

text
www.example.com. 3600 IN CNAME example.com.
CNAME restrictionA CNAME record cannot coexist with other records at the same name. You cannot have a CNAME at the zone apex (bare domain like example.com) alongside SOA and NS records. Services like Cloudflare offer CNAME flattening to work around this.

Learn more: What Is a CNAME Record?

MX Record

An MX (Mail Exchanger) record specifies the mail servers responsible for receiving email for a domain. MX records include a priority value — lower numbers have higher priority. Multiple MX records provide redundancy.

text
example.com. 3600 IN MX 10 mail1.example.com. example.com. 3600 IN MX 20 mail2.example.com.

Learn more: What Is an MX Record?

TXT Record

A TXT (Text) record stores arbitrary human-readable or machine-readable text. TXT records are widely used for domain ownership verification, email authentication (SPF, DKIM, DMARC), and site verification for services like Google Search Console.

text
example.com. 3600 IN TXT "v=spf1 include:_spf.google.com ~all" example.com. 3600 IN TXT "google-site-verification=abc123xyz"

Learn more: What Is a TXT Record?

NS Record

An NS (Name Server) record identifies the authoritative nameservers for a domain. Every domain must have at least two NS records for redundancy. NS records are set at the registrar and delegate DNS authority to the listed servers.

text
example.com. 86400 IN NS ns1.example-dns.com. example.com. 86400 IN NS ns2.example-dns.com.

Learn more: What Is an NS Record?

SOA Record

An SOA (Start of Authority) record is the first record in every DNS zone. It defines key administrative information about the zone, including the primary nameserver, the zone administrator's email address, and timing parameters that control zone transfers and caching.

text
example.com. 86400 IN SOA ns1.example-dns.com. admin.example.com. ( 2024120101 ; Serial number (YYYYMMDDNN format) 3600 ; Refresh — how often secondaries check for updates 900 ; Retry — how long before secondary retries a failed refresh 604800 ; Expire — how long secondaries serve stale data after failure 300 ; Minimum TTL for negative caching )

Learn more: What Is an SOA Record?

SRV Record

An SRV (Service) record specifies the host and port for specific services. It is used by applications like SIP (VoIP), XMPP (messaging), and Microsoft Teams to discover service endpoints from DNS.

text
_sip._tcp.example.com. 3600 IN SRV 10 20 5060 sip.example.com. ; Priority Weight Port Target

CAA Record

A CAA (Certification Authority Authorization) record specifies which Certificate Authorities (CAs) are allowed to issue SSL/TLS certificates for a domain. If a CA is not listed in the CAA record, it should refuse to issue a certificate, reducing the risk of fraudulent certificates.

text
example.com. 3600 IN CAA 0 issue "letsencrypt.org" example.com. 3600 IN CAA 0 issuewild "letsencrypt.org" example.com. 3600 IN CAA 0 iodef "mailto:security@example.com"

PTR Record

A PTR (Pointer) record is used for reverse DNS lookups — mapping an IP address back to a domain name. PTR records are stored in the special in-addr.arpa (IPv4) or ip6.arpa (IPv6) zones and are managed by the IP address owner (typically your hosting provider or ISP).

text
34.216.184.93.in-addr.arpa. 3600 IN PTR example.com.

Learn more: What Is Reverse DNS?

Summary Table

Record TypePurposeCommon Use
AMaps domain to IPv4 addressWebsite hosting, server pointing
AAAAMaps domain to IPv6 addressIPv6 website hosting
CNAMEAlias from one domain to anotherwww subdomain, CDN configuration
MXMail server for a domainEmail routing (Gmail, Outlook)
TXTArbitrary text dataSPF, DKIM, DMARC, domain verification
NSAuthoritative nameserversDNS delegation
SOAZone authority informationZone administration, serial numbers
SRVService location and portVoIP, XMPP, Microsoft Teams
CAACertificate authority authorizationRestrict SSL certificate issuers
PTRReverse DNS (IP to domain)Email server reputation, logging
Check all DNS records at onceUse the ShowDNS Check All DNS Records tool to see every record type for a domain in a single view.

Frequently Asked Questions

How many DNS records can a domain have?

There is no hard limit on the number of DNS records a domain can have. You can have multiple A records (for load balancing), multiple MX records (for redundancy), and multiple TXT records (for different services). However, very large zone files can increase DNS response sizes, which may cause issues with UDP packet size limits.

What is DNS TTL and why does it matter?

TTL (Time-to-Live) is the number of seconds resolvers cache a DNS record before re-fetching it. Lower TTLs mean changes propagate faster but increase DNS query load. Higher TTLs reduce query volume but slow down propagation. Learn more: What Is DNS TTL?

Can I have multiple A records for the same domain?

Yes. Multiple A records for the same domain implement round-robin DNS load balancing. Resolvers return the IP addresses in rotation, distributing traffic across multiple servers.

What is the difference between a CNAME and an A record?

An A record points directly to an IP address. A CNAME points to another domain name, which must then resolve to an IP via its own A record. CNAMEs are useful for aliasing subdomains or pointing to CDN endpoints that may change their IP addresses.

How do I check DNS records for a domain?

Use the ShowDNS DNS Lookup tool to query any record type, or the Check All DNS Records tool to see the complete picture. From the command line, use dig example.com ANY or individual queries like dig example.com MX.

Related Articles