DNS Record Types Explained:A, AAAA, CNAME, MX, TXT and More
What each common DNS record type does, with practical examples: A, AAAA, CNAME, MX, TXT, NS, SRV and CAA, plus the mistakes that most often take websites and email offline.

Table of Contents
DNS records are the entries in your domain's DNS zone that tell the internet where your services live. The ones you will use most are A (the IPv4 address of a name), AAAA (IPv6 address), CNAME (an alias to another name), MX (mail servers), TXT (text for verification and email security), NS (nameservers), SRV (specific services) and CAA (which certificate authorities may issue SSL certificates).
The table below summarises them; each one is explained with an example afterwards.
Quick reference
| Type | Points to | Typical use |
|---|---|---|
| A | IPv4 address | Website on a server |
| AAAA | IPv6 address | Website on a server with IPv6 |
| CNAME | Another hostname | www or a subdomain pointing to a service |
| MX | Mail server hostname, with priority | Receiving email |
| TXT | Text | SPF, DKIM, DMARC, ownership verification |
| NS | Nameserver hostnames | Delegating the domain or a subdomain |
| SRV | Host, port, priority, weight | Some voice, chat and directory services |
| CAA | Certificate authority name | Restricting who can issue SSL certificates |
In DNS editors, @ means the domain itself (example.com).
A record
example.com. 3600 IN A 203.0.113.10
Maps a name to an IPv4 address. Use it for the root domain and any hostname that points directly to a server. To move a website to a new host without changing nameservers, you usually change the A record.
AAAA record
example.com. 3600 IN AAAA 2001:db8::10
The IPv6 equivalent of the A record. Only add it if your server really serves the site over IPv6; a wrong AAAA record breaks the site for visitors on IPv6.
CNAME record
www.example.com. 3600 IN CNAME example.com.
Makes one name an alias of another. Resolvers look up the target and use its addresses.
Rules to remember:
- A name with a CNAME cannot have any other records. You cannot put a CNAME on the root domain (
example.com) in standard DNS, because the root also needs NS and usually MX records. Some DNS providers offer "CNAME flattening" or ALIAS records to get around this. - Never point an MX record at a CNAME.
MX record
example.com. 3600 IN MX 10 mail.example.com.
example.com. 3600 IN MX 20 backup-mail.example.com.
Tells sending servers where to deliver email for the domain. The number is the priority: lower numbers are tried first. MX records point to hostnames, never directly to IP addresses. See MX records explained.
TXT record
example.com. 3600 IN TXT "v=spf1 include:_spf.example-mail.com ~all"
Holds text. Common uses:
- SPF: which servers may send email for the domain (only one SPF record per name);
- DKIM: a public key for verifying signed email, usually on a name like
selector._domainkey; - DMARC: the policy for failed email checks, on
_dmarc.example.com; - verification for services such as search console tools or email providers.
See SPF, DKIM and DMARC explained.
NS record
Lists the authoritative nameservers. NS records for the domain itself are managed with your nameserver setting at the registrar. You can also add NS records for a subdomain to delegate it to a different DNS service.
SRV record
_sip._tcp.example.com. 3600 IN SRV 10 60 5060 sip.example.com.
Specifies the host and port for a particular service, with priority and weight. Some communication, calendar and directory services ask you to add SRV records.
CAA record
example.com. 3600 IN CAA 0 issue "letsencrypt.org"
Lists the certificate authorities allowed to issue certificates for the domain. If you add CAA records, include every authority your hosting uses for SSL, or certificate renewals will fail.
Example: a complete zone for a small business
A business with its website on a hosting server, email on a separate service, and a helpdesk on a subdomain:
| Name | Type | Value | Purpose |
|---|---|---|---|
@ |
A | 203.0.113.10 |
Website |
www |
CNAME | example.com. |
www goes to the same site |
@ |
MX | 1 mx1.mailservice.example. |
Email delivery |
@ |
MX | 5 mx2.mailservice.example. |
Backup mail server |
@ |
TXT | v=spf1 include:_spf.mailservice.example ~all |
SPF |
mail1._domainkey |
CNAME | mail1.dkim.mailservice.example. |
DKIM |
_dmarc |
TXT | v=DMARC1; p=quarantine; rua=mailto:[email protected] |
DMARC |
help |
CNAME | example.helpdesk.example. |
Helpdesk subdomain |
@ |
CAA | 0 issue "letsencrypt.org" |
Allowed certificate authority |
@ |
TXT | google-site-verification=... |
Search Console verification |
Every record has a clear purpose; nothing is left over from old services. Keeping such a table in your documentation makes moves and audits much easier.
Common mistakes
- Editing records at the wrong place: changes must be made at the DNS host your nameservers point to. See nameservers vs DNS records.
- Two SPF records on the same name, which makes SPF fail. Merge them into one.
- Deleting MX or verification TXT records while moving a website.
- A CNAME next to other records on the same name.
- A stale AAAA record after moving to a server without IPv6.
- Forgetting the trailing dot or the zone suffix, which some editors add automatically and others do not.
Frequently Asked Questions
What TTL should I use?
3600 seconds (one hour) is a sensible default. Lower it to around 300 a day before planned changes.
Should www be a CNAME or an A record?
Either works. A CNAME to the root domain means you only update one A record when the server changes.
How do I check what records my domain has?
Use a DNS lookup tool, query one type at a time from a terminal (for example dig example.com MX or nslookup -type=TXT example.com), or view the zone in your DNS host's panel. Many DNS servers no longer answer "ANY" queries in full, so ask for each record type separately.
Related reading
To edit records in cPanel, see how to edit DNS records in cPanel Zone Editor. For how DNS works overall, read what is DNS, and manage your domains through the ServerNeed domain search.
Sources
Last updated 7 October 2026



