DNS record types explained

A, AAAA, CNAME, MX, TXT, NS, CAA and SRV: what each DNS record does, with real examples you can copy.

2–3 minutes
Network switch with many blue patch cables

A domain’s DNS zone is a list of records. Each record has a name (which hostname it applies to), a type, a value and a TTL. These are the types you will meet most.

TypePoints a name toExample value
AAn IPv4 address203.0.113.10
AAAAAn IPv6 address2001:db8::10
CNAMEAnother hostnameexample.com.
MXA mail server, with a priority10 mail.example.com.
TXTFree text, used for verification and email security"v=spf1 mx -all"
NSThe nameservers for the domain or a subdomainns1.provider.net.
CAAWhich certificate authorities may issue certificates0 issue "letsencrypt.org"
SRVA service’s host and port10 5 5060 sip.example.com.

A and AAAA

The core records. example.com with an A record of 203.0.113.10 sends visitors to that server. Add an AAAA record only if the server really has a working IPv6 address; a wrong AAAA record breaks the site for visitors on IPv6.

CNAME

An alias. www.example.com CNAME example.com means “look up whatever example.com points to”. Two rules catch people out:

  • A name with a CNAME cannot have any other record.
  • The bare domain (example.com itself, often shown as @) cannot be a CNAME, because it must also hold NS and SOA records. Some DNS providers offer “CNAME flattening” or ALIAS records to get around this.

MX

Tells other mail servers where to deliver email for the domain. The number is a priority: lower is tried first. MX must point to a hostname that has an A record, never to an IP address or a CNAME.

TXT

Holds text. Used for domain verification with services, and for email security: SPF, DKIM and DMARC all live in TXT records.

NS

Says which nameservers are authoritative. The NS records at your registrar decide who controls the whole domain. NS records inside your zone can hand a subdomain to a different provider.

CAA

Optional, but a good safety step: it lists which certificate authorities may issue certificates for your domain. Others must refuse.

Names, @ and the trailing dot

Most DNS panels write the bare domain as @ and add your domain to any name you type, so www means www.example.com. In raw zone files, a hostname ending in a dot is complete; one without a dot has the domain added. When a panel shows mail.example.com.example.com, a missing or extra dot is usually why.

Something out of date? Software changes. If a step no longer works, tell us and we will check it and update the page.