Confused by the A, CNAME, MX and TXT rows in your domain’s settings? This is DNS records explained in plain terms: A points to a server, CNAME aliases a name, MX routes email, TXT proves things.
If you want the bigger picture first, read what is a domain name and then come back to the records.
| Item | Value |
|---|---|
| Common default TTL | 3600 seconds (one hour) |
| Short TTL before a planned change | 300 seconds |
| When to lower the TTL | 24 hours before a migration |
| Maximum size of one record on Cloudflare | 4,096 bytes |
| SPF records allowed per domain | One |
These figures come from the WebsiteSetup DNS records cheat sheet and the Cloudflare DNS record types documentation. Providers and defaults can change, so check the source before you rely on them.
What a DNS record contains
A DNS record is an entry in a DNS zone file that maps a domain name to a destination, as DomainDetails describes it. The full set of records for one domain is called a zone, according to the WebsiteSetup cheat sheet.
Every record is built from the same few parts:
- Name: the domain or subdomain the record applies to, where @ means the bare domain.
- Type: the kind of instruction, such as A, CNAME, MX or TXT.
- Value: the answer the record returns, such as an address, a hostname or a piece of text.
- TTL: how long other servers may remember the answer before asking again.
The reason this matters is simple: when someone types your domain, their computer asks DNS servers where to find you, and DNS answers with instructions that browsers and mail servers understand. That behaviour is described on the WebsiteSetup cheat sheet. Each record you add is one of those instructions.
A and AAAA records: pointing a name to a server
An A record maps a name to an IPv4 address, and an AAAA record does the same job for IPv6, as the WebsiteSetup cheat sheet explains. If your host gives you an IPv6 address, add an AAAA record next to the A record.
The usual website setup is short: send the bare domain to your server’s address with an A record, then send www to the domain with a CNAME. For the full walk-through, see our guide on how to point a domain to hosting.
CNAME records: aliases and the root domain limit
A CNAME is an alias. It points to another name, never to an IP address, according to the WebsiteSetup cheat sheet.
That makes CNAMEs handy for subdomains that live on someone else’s service. They come with two firm limits:
- A CNAME cannot be used on the root domain.
- A CNAME cannot sit beside other record types for the same name.
- The target must be a hostname, so you cannot paste an IP address into it.
The first two limits are listed in the DomainDetails guide. If you need an alias on the bare domain, the cheat sheet suggests an ALIAS or ANAME record, or Cloudflare’s CNAME flattening, which resolves the target and serves an A record for you (WebsiteSetup).

Cloudflare says it uses a process called CNAME flattening to deliver better performance, per its DNS record types page. Other providers may handle the root domain differently, so check your own dashboard.
MX records: where your email goes
An MX record names the mail servers that accept email for your domain. Each one carries a priority number, and a lower number wins, as the DomainDetails guide notes.
Three rules keep mail flowing:
- Point each MX at a domain name. DNSimple says MX entries must point to a domain, and never point directly to an IP address.
- Do not point an MX at a CNAME. The WebsiteSetup cheat sheet says an MX must point to a real hostname.
- Add backup servers with higher priority numbers if your mail provider supplies them.
Your email host will usually give you the exact MX values to paste in. Copy them as given.
TXT records: verification and email authentication
A TXT record holds text for other systems to read. DNSimple notes that these records are not used to direct any traffic, but to provide information to outside sources.
Most of the TXT records you add will fall into one of these jobs:
- Domain verification: a single generated value that tools such as search consoles ask you to publish.
- SPF: lists who is allowed to send mail as your domain.
- DKIM: a public key that lets receivers check a cryptographic signature on your outgoing mail.
- DMARC: sets the policy for mail that fails SPF or DKIM and asks for reports.
Mistakes here break email, so go slowly. A domain may have only one SPF record, and two separate SPF TXT records produce a PermError that can break your mail, per the WebsiteSetup cheat sheet. Merge them into one line instead.
For DMARC, the same page advises starting at p=none so you only monitor, then moving to quarantine and then reject once the reports look clean. Cloudflare also sets a limit: each record has a maximum wire format size of 4,096 bytes (Cloudflare docs).
TTL, NS, SOA and CAA: the supporting records
TTL is the number of seconds a resolver may cache a record before it asks again. A common default is 3600 seconds, which is one hour, according to the WebsiteSetup cheat sheet. A higher TTL means faster lookups and fewer queries, but slower updates when you change something.
When you plan to change a record, follow this order:
- Lower the TTL on the record ahead of time.
- Wait for the old, longer TTL to age out.
- Switch the record to its new value.
- Raise the TTL again once things are stable.
The cheat sheet’s timing is about 24 hours before the move, lowering the record to 300 seconds, per WebsiteSetup. On Cloudflare, a proxied record defaults to Auto, which is 300 seconds (Cloudflare docs).
Three more record types round out a typical zone:
- NS: names the authoritative servers that hold your zone, so it decides which provider answers DNS questions for the domain.
- SOA: holds administrative details about the zone. Your provider creates and manages it, so you rarely edit it by hand.
- CAA: restricts which certificate authorities may issue TLS certificates for your domain.
These descriptions follow the WebsiteSetup cheat sheet. Moving a domain between registrars is a separate process, covered in our guide on how to transfer a domain name.
Frequently asked questions
What happens if my domain has no MX record?
Show answer
Per DNSimple, a sending server that finds no MX record will try the matching A record instead. Relying on that fallback is risky, so publish a proper MX for any domain that should receive mail.
Can I keep two SPF records if they cover different services?
Show answer
No. Put every sender into a single SPF record using several include entries, because separate records trigger an error, as the WebsiteSetup cheat sheet warns.
Why has my DNS change not shown up yet?
Show answer
You are waiting on the old TTL plus resolver caching around the world, not on a fixed clock, according to WebsiteSetup. Lowering the TTL before a change is the real lever.
Where do I set NS records?
Show answer
NS records are set at your registrar, per DomainDetails. Changing them hands DNS control to whichever provider you name.
Should www be an A record or a CNAME?
Show answer
Either works. A CNAME is convenient when www should follow whatever the bare domain resolves to, while an A record is a direct address entry. The WebsiteSetup cheat sheet uses a CNAME for www.



