DNS records explained: A, AAAA, CNAME, MX, TXT and more
When you type a domain name, your device asks the Domain Name System where to go. The answers live in DNS records, small entries you manage at wherever your domain's DNS is hosted. Understanding the handful of common record types lets you point a website at your server, set up email and verify ownership without guessing.
The basic idea
A DNS record has a few parts:
- Name (or host): which name the record is for, such as
@for the bare domain,wwwormail. - Type: what kind of answer it gives.
- Value: the answer, such as an IP address.
- TTL: how long, in seconds, other systems may remember the answer before asking again.
The common record types
A record
Points a name to an IPv4 address. This is the one you use to send a domain to your server.
| Name | Type | Value |
|---|---|---|
@ | A | 203.0.113.10 |
www | A | 203.0.113.10 |
AAAA record
The same as an A record, but for IPv6 addresses. Only add one if your server really listens on IPv6, or visitors using IPv6 may reach nothing.
CNAME record
Makes one name an alias of another name. For example, www can be a CNAME for example.com, so changing the address once updates both.
Two rules matter: a CNAME cannot sit on the bare domain (@) alongside other records, and a name with a CNAME should have no other records. Breaking this causes odd failures, particularly with email.
MX record
Says which servers receive email for your domain. Each has a priority number: lower is tried first. The value must be a hostname, never an IP address and never a CNAME.
TXT record
Holds free text. Today it is mostly used to prove things: that you own the domain for a service, and for email authentication such as SPF, DKIM and DMARC. See How to set up SPF, DKIM and DMARC.
NS record
Names the servers that answer for your domain. You normally change these only when moving DNS to a new provider, at the registrar. Changing them moves every record, so check that your new provider has all the records first.
SRV record
Gives a hostname and port for a specific service. Some game software uses these. For example, Minecraft Java can read an SRV record so players connect to play.example.com without typing a port. See How to connect a domain to your server for the practical steps.
CAA record
Limits which certificate authorities may issue certificates for your domain. It is optional, but a good safety measure once you know which one you use.
TTL and propagation
TTL controls caching. A low TTL such as 300 seconds (five minutes) means changes spread quickly, and a high one such as 86400 (a day) reduces lookups. When you plan to move a site, lower the TTL a day or two earlier, make the change, then raise it again.
"Propagation" is not a mysterious process. It is simply old answers expiring from caches. Most changes show within minutes, but some places hold on for the TTL, and a few ignore it.
Checking your records
From any computer with dig or nslookup:
dig example.com A +short
dig www.example.com CNAME +short
dig example.com MX +short
dig example.com TXT +short
To ask a specific resolver, such as Cloudflare's, add @1.1.1.1. If you see different answers from different resolvers, you are probably waiting on caches. Compare with the authoritative server using dig example.com @ns1.your-dns-host.com.
Using Cloudflare or a similar proxy
Some DNS hosts can proxy traffic, hiding your server address. That changes behaviour: the A record returns the proxy's address, not yours, and certain ports (such as a game port) do not pass through. For game servers, set the record to DNS only, not proxied. For websites, proxying is fine.
A typical website setup
| Name | Type | Value |
|---|---|---|
@ | A | your server's IPv4 |
www | CNAME | @ or your domain |
@ | MX | your mail provider |
@ | TXT | SPF record |
Then install a certificate. See How to set up an SSL certificate.
Common mistakes
- Trailing dots and typos. Some panels need the full name to end in a dot, others add the domain for you, giving
example.com.example.com. - Duplicate A records pointing to old and new servers, so half your visitors hit each one.
- A CNAME on the bare domain. Use an A record, or your provider's special alias record.
- Forgetting that the registrar and the DNS host can differ. Edit records where the nameservers point.
- Impatience. Check the TTL before concluding something is broken.
If a site is not loading after you change DNS, work through the steps in Fixing "Connection timed out" versus "Connection refused".
Still stuck? Open a ticket on Discord - run /ticket in any channel, pick a department, and include your Server ID or Invoice ID so we can jump straight in.