DNS Record Types Explained: A, MX, CNAME, TXT & More

Updated February 6, 2026

The Domain Name System (DNS) is the internet's directory service. It translates human-readable domain names like example.com into the data that computers need — IP addresses, mail server locations, security policies, and more. This translation happens through DNS records, each serving a specific purpose.

This guide covers every common DNS record type, what it does, when to use it, and practical examples.

Quick Reference Table

Record TypePurposeExample Value
AMaps domain to IPv4 address93.184.216.34
AAAAMaps domain to IPv6 address2606:2800:220:1:248:1893:25c8:1946
CNAMEAlias to another domain namewww.example.com
MXMail server for the domain10 mail.example.com
TXTArbitrary text data (SPF, DKIM, verification)v=spf1 include:_spf.google.com -all
NSAuthoritative nameserversns1.exampledns.com
SOAZone authority and timing parametersns1.example.com admin.example.com ...
PTRReverse DNS (IP to hostname)mail.example.com
SRVService location and port10 5 5060 sip.example.com
CAACertificate authority authorization0 issue "letsencrypt.org"

Look up any DNS record type for any domain.

Free, instant, no login required.

Launch DNS Lookup Tool

A Record

The A record (Address record) is the most fundamental DNS record. It maps a domain name to an IPv4 address.

example.com.       A    93.184.216.34
www.example.com.   A    93.184.216.34

When to use: Every domain that serves a website or any other service over IPv4 needs at least one A record. You can have multiple A records for the same domain to distribute traffic across servers (round-robin DNS).

AAAA Record

The AAAA record (quad-A) is the IPv6 equivalent of the A record. It maps a domain name to an IPv6 address.

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

When to use: If your servers support IPv6, publish AAAA records alongside your A records. IPv6 adoption is growing steadily and having AAAA records ensures your services are accessible to IPv6-only clients.

CNAME Record

The CNAME record (Canonical Name) creates an alias from one domain name to another. When a resolver encounters a CNAME, it follows the alias and looks up the target domain instead.

www.example.com.      CNAME    example.com.
blog.example.com.     CNAME    myapp.hosting-provider.com.

When to use: Use CNAME records when you want a subdomain to point to another hostname, especially one managed by a third-party service (CDNs, hosting platforms, SaaS tools). This way, if the service changes its IP addresses, your records update automatically.

A CNAME record cannot coexist with other record types at the same name. You cannot have a CNAME and an MX record (or A record, or TXT record) on the same subdomain. For the root domain (apex), most DNS providers do not allow CNAME records — use an A record or look for provider-specific alternatives like ALIAS or ANAME records.

MX Record

The MX record (Mail Exchange) specifies which mail servers accept email for the domain. Each MX record includes a priority value — lower numbers have higher priority.

example.com.    MX    10    mail1.example.com.
example.com.    MX    20    mail2.example.com.

When to use: Any domain that receives email must have MX records. Multiple records provide redundancy. For a deep dive, see our MX records guide.

TXT Record

The TXT record stores arbitrary text data. Originally designed for human-readable notes, TXT records are now critical for email security and domain verification.

Common uses:

PurposeExample
SPF (email auth)v=spf1 include:_spf.google.com -all
DKIM (email signing)v=DKIM1; k=rsa; p=MIGfMA0...
DMARC (email policy)v=DMARC1; p=reject; rua=mailto:[email protected]
Domain verificationgoogle-site-verification=abc123...
Custom dataAny text string up to 255 characters per chunk

When to use: TXT records are essential for email authentication (SPF, DKIM, DMARC) and for verifying domain ownership with third-party services like Google Search Console, Microsoft 365, and various SaaS platforms.

NS Record

The NS record (Name Server) identifies the authoritative DNS servers for a domain. These are the servers that hold the definitive DNS records for the zone.

example.com.    NS    ns1.exampledns.com.
example.com.    NS    ns2.exampledns.com.

When to use: NS records are typically set at your domain registrar to delegate DNS to your chosen DNS hosting provider. You can also use NS records to delegate subdomains to different DNS servers. For a deeper look at how NS records form the delegation chain from root servers to your domain, see our DNS delegation guide.

NS records at the zone apex are critical infrastructure. Changing them incorrectly can make your entire domain unreachable. Always verify new nameservers are properly configured before updating NS records at your registrar.

SOA Record

The SOA record (Start of Authority) contains administrative information about the DNS zone, including the primary nameserver, the zone administrator's email, and timing parameters for zone transfers and caching.

example.com.    SOA    ns1.example.com. admin.example.com. (
                       2024020601  ; Serial number
                       7200        ; Refresh (2 hours)
                       3600        ; Retry (1 hour)
                       1209600     ; Expire (14 days)
                       86400       ; Minimum TTL (1 day)
                       )

When to use: Every DNS zone has exactly one SOA record. It is created automatically by your DNS provider. You generally only modify it if you manage your own DNS infrastructure.

PTR Record

The PTR record (Pointer) maps an IP address to a hostname — the reverse of an A record. PTR records are stored in a special reverse DNS zone.

34.216.184.93.in-addr.arpa.    PTR    mail.example.com.

When to use: PTR records are critical for mail servers. Many receiving mail servers perform a reverse DNS lookup on the sending IP and reject the email if there is no PTR record or if it doesn't match the expected hostname. PTR records are managed by your hosting or IP address provider, not your domain registrar.

SRV Record

The SRV record (Service) specifies the hostname and port for specific services. It is used by protocols that need to discover service locations dynamically.

_sip._tcp.example.com.    SRV    10 5 5060 sip.example.com.
_xmpp._tcp.example.com.   SRV    5 0 5222 xmpp.example.com.

The format is: priority weight port target

FieldDescription
priorityLower values are preferred (like MX)
weightFor load balancing between same-priority records
portThe TCP/UDP port the service listens on
targetThe hostname providing the service

When to use: SRV records are used for VoIP (SIP), instant messaging (XMPP), Microsoft Active Directory, and other service-discovery protocols. Not all applications support SRV lookups.

CAA Record

The CAA record (Certificate Authority Authorization) specifies which certificate authorities (CAs) are allowed to issue SSL/TLS certificates for your domain.

example.com.    CAA    0 issue "letsencrypt.org"
example.com.    CAA    0 issuewild "letsencrypt.org"
example.com.    CAA    0 iodef "mailto:[email protected]"
TagDescription
issueCAs authorized to issue regular certificates
issuewildCAs authorized to issue wildcard certificates
iodefWhere to report policy violations

When to use: CAA records are a security best practice. They prevent unauthorized CAs from issuing certificates for your domain. If no CAA record exists, any CA can issue a certificate. Adding CAA records limits issuance to only the CAs you specify.

If you use Let's Encrypt for free SSL certificates, add a CAA record with 0 issue "letsencrypt.org". This protects your domain while still allowing certificate issuance for your hosting setup.

Choosing the Right Record Type

Here is a quick decision guide:

  • Pointing a domain to a web server? Use an A record (and AAAA for IPv6).
  • Creating a subdomain alias? Use a CNAME record.
  • Setting up email? Use MX records for receiving and TXT records for SPF, DKIM, and DMARC.
  • Verifying domain ownership? Use a TXT record with the verification string.
  • Restricting SSL certificate issuance? Use a CAA record.
  • Enabling service discovery? Use an SRV record.
  • Setting up reverse DNS? Contact your IP provider to create a PTR record.

Looking Up DNS Records

You can look up any DNS record using command-line tools:

# Look up A records
dig A example.com +short

# Look up all record types
dig ANY example.com

# Look up a specific type
dig MX example.com +short
dig TXT example.com +short
dig CAA example.com +short

For a step-by-step walkthrough of DNS lookups, see How to Check DNS Records. To understand why changes to your records may not appear immediately, read about DNS propagation.

Look up DNS records for any domain instantly.

Free, instant, no login required.

Launch DNS Lookup Tool

Ready to check your domain?

Use our free dns lookup tool to put this knowledge into practice.

Launch DNS Lookup Tool