DNS Record Types Explained: A, AAAA, CNAME, MX, TXT, NS and CAA

Every DNS record you will meet running a site or email — what each is for, what goes in it, and the mistakes behind "site down" and "mail bounced".

Published
Reading time
4 min

A DNS zone is a small table of records, and there are only eight kinds you will ever need to touch. Here is what each one does, what goes in it, and the way each one usually goes wrong. If the overall lookup process is new to you, read how DNS works first.

A — the website's IPv4 address

example.com.      A    203.0.113.10
www.example.com.  A    203.0.113.10

The record browsers use. You need one for the bare domain and one for www (or a CNAME for www, below). Common mistake: changing hosts and updating only one of the two, so example.com moves and www.example.com stays on the old server.

AAAA — the same, for IPv6

example.com.  AAAA  2001:db8::10

Optional, but worth adding if your host provides an IPv6 address: some mobile networks are IPv6-first and reach an AAAA-enabled site slightly faster. Common mistake: a stale AAAA left pointing at an old server, so IPv6 visitors see the old site while IPv4 visitors see the new one. See IPv4 vs IPv6 for hosting.

CNAME — an alias to another name

www.example.com.   CNAME  example.com.
shop.example.com.  CNAME  shops.myshopify.com.

"Look up this other name instead." Used for www, and for services hosted elsewhere. Two hard rules: a CNAME cannot coexist with any other record for the same name, and the bare domain cannot be a CNAME (it has NS and SOA records). For the root, use an A record or your provider's ALIAS/ANAME flattening. Common mistake: a missing trailing dot in some editors, turning example.com into example.com.example.com.

MX — where email is delivered

example.com.  MX  10  mail.example.com.
example.com.  MX  20  backup-mail.example.com.

The number is priority — lower is tried first. The value must be a hostname, never an IP, and that hostname needs its own A record. Common mistake: moving the website to a new host and forgetting that the old host was also handling email; the MX still points there, and mail stops when the old account is closed.

TXT — text, mostly for proof and policy

example.com.         TXT  "v=spf1 a mx include:_spf.google.com -all"
_dmarc.example.com.  TXT  "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com"
example.com.         TXT  "google-site-verification=abc123"

Free-form text used by other systems: SPF and DMARC for email, DKIM keys under selector._domainkey, and ownership verification for Google, Microsoft and others. Common mistake: two SPF records — the standard allows exactly one, and having two means SPF fails for everyone. The email records are explained in SPF, DKIM and DMARC.

NS — which servers hold this zone

example.com.  NS  ns1.vpspioneer.com.
example.com.  NS  ns2.vpspioneer.com.

The delegation. Set at the registrar, mirrored inside the zone. Changing NS moves the entire zone to a different provider, so every other record must already exist there before you switch. Common mistake: changing nameservers to move the site, and losing all the MX and TXT records that were only on the old provider.

SRV — a service on a specific port

_sip._tcp.example.com.  SRV  10 60 5060 sip.example.com.

Priority, weight, port, target. Used by VoIP, Microsoft 365 autodiscover, Minecraft servers and similar. You will rarely write one by hand; the service tells you the exact record.

CAA — which authorities may issue certificates

example.com.  CAA  0 issue "letsencrypt.org"
example.com.  CAA  0 issuewild "letsencrypt.org"

A small security record that says only these certificate authorities may issue for your domain. Every CA is required to check it. Common mistake: adding CAA for one authority and then failing to get a certificate from another — the error looks like a validation failure but is CAA.

PTR — the reverse record

Not in your zone at all: PTR maps an IP back to a name and lives with whoever owns the IP, usually your hosting provider. Mail servers check it. Full explanation: reverse DNS and why email needs it.

Two fields on every record

TTL — how long resolvers may cache the answer. 3600 is a normal default; drop it to 300 a day before any change. Name — either the full name with a trailing dot (www.example.com.) or a relative one (www) depending on the editor; mixing the two forms is the source of most doubled-domain typos.

Check any record from a terminal

bash
dig example.com A +short
dig example.com MX +short
dig example.com TXT +short
dig _dmarc.example.com TXT +short
dig example.com NS +short
dig example.com CAA +short

Plesk creates the A, AAAA, CNAME, MX and SPF records automatically for every domain you add, and managing DNS in Plesk covers editing them. If a change is not showing, dig @1.1.1.1 and dig @8.8.8.8 side by side will tell you whether it is the record or the cache.

#dns#networking#records#email

Keep reading

More from Networking

All guides

Networking

How DNS Works: What Happens When You Type a Domain

A DNS lookup step by step — resolver, root, TLD and authoritative servers, TTL and caching — and why "propagation" takes time.

4 min read →

Migration

How to Move a Website to a New Host Without Downtime

The zero-downtime migration sequence we use for every site — copy files and database, test with a hosts-file trick, lower the DNS TTL, then switch.

3 min read →

Linux

How to Create a Sudo User and Disable Root SSH Login

Create a user with sudo rights on Ubuntu, Debian, AlmaLinux or Rocky, test it, then lock root out of SSH without locking yourself out.

3 min read →