DNS records explained: A, AAAA, CNAME, MX and TXT
DNS records tell the internet where your domain's website and email are, and prove things about your domain to other services. Each record has a name, a type and a value.
If your domain uses Spiderz's nameservers, you edit these records in cPanel's Zone Editor. Otherwise, edit them where your DNS is managed. Find out who manages your domain and DNS shows you where.
The examples below use yourdomain.com and addresses reserved for documentation. Don't copy them.
The records at a glance
| Type | What it does | Value |
|---|---|---|
| A | Points a name to an IPv4 address | An address such as 192.0.2.10 |
| AAAA | Points a name to an IPv6 address | An address such as 2001:db8::10 |
| CNAME | Makes a name an alias of another name | A host name such as yourdomain.com |
| MX | Says where email for the domain is delivered | A priority and a host name |
| TXT | Holds text for verification and email policies | Text, given by the service |
| NS | Names the domain's nameservers | Host names |
| CAA | Limits who can issue certificates for the domain | A flag, a tag and an issuer |
The fields in a DNS editor
| Field | What it is |
|---|---|
| Name (or Host) | The name the record is for. @ usually means the domain itself; www means www.yourdomain.com. Some editors want the full name. |
| Type | A, AAAA, CNAME, MX, TXT and so on. |
| Value (or Content, Target) | The answer: an address, a host name or text. Never a web address with https:// or a path. |
| TTL | How long, in seconds, other servers may keep the answer before asking again. 3600 is one hour. |
| Priority | MX only. A lower number is tried first. |
Check the full name before you save. An editor that adds the domain automatically turns www.yourdomain.com into www.yourdomain.com.yourdomain.com.
A
Name: @
Type: A
Value: 192.0.2.10
Points the name to a server's IPv4 address. For Spiderz hosting, the value is your account's Shared IP Address, under General Information in cPanel.
A name can have more than one A record, and visitors are then split between them. When you move a site, replace the old address; don't add the new one next to it.
With Cloudflare's proxy on, lookups return Cloudflare's addresses instead of yours. That's expected.
AAAA
Name: @
Type: AAAA
Value: 2001:db8::10
The IPv6 version of an A record. A name can have both. When you move a site, check AAAA records too: an old one keeps sending IPv6 visitors to the previous server. Spiderz hosting has no IPv6 address, so when you move to Spiderz, delete them.
CNAME
Name: www
Type: CNAME
Target: yourdomain.com
Makes www.yourdomain.com use whatever address yourdomain.com has.
- A CNAME doesn't redirect. The address bar still shows
www. A redirect is set on the web server. - A name with a CNAME can't have any other record.
- The domain itself (
@) can't be a CNAME, because it always has other records. Some providers, including Cloudflare, offer a flattened alias for it instead. Cloudflare's CNAME flattening
MX
Name: @
Type: MX
Priority: 10
Target: mail.yourdomain.com
Tells other mail servers where to deliver your email. The target is a host name, never an IP address or an email address, and that name needs its own A record. It shouldn't be a CNAME.
Providers often give several MX records with different priorities. Add all of them, exactly as given. Adding a second provider's MX doesn't give you a backup; it splits your mail.
If you change the website's A record, check the MX target doesn't depend on it. Move your website without interrupting email explains how.
TXT
Name: @
Type: TXT
Value: service-verification=abc123
Holds text that services read. A name can have many TXT records for different purposes. Add new ones; don't replace the others. Some live under their own names, such as _dmarc, so a lookup on the domain alone won't show them.
Email records: SPF, DKIM and DMARC
These are TXT records that help other mail services trust email from your domain. If your domain uses Spiderz's nameservers, cPanel creates SPF and DKIM for you.
| Record | Name | What it does |
|---|---|---|
| SPF | @ |
Lists the servers allowed to send email for your domain. Starts with v=spf1. |
| DKIM | A selector, such as default._domainkey |
Holds a key that receiving servers use to check your messages weren't changed. |
| DMARC | _dmarc |
Says what receivers should do with messages that fail SPF and DKIM. Starts with v=DMARC1. |
A domain can have only one SPF record. To allow another sender, add it to the existing record; a second SPF record breaks both.
In cPanel, Email Deliverability shows whether these records are valid for your domain.
NS
NS records name the nameservers for a domain. What counts is the nameserver setting at your registrar. Editing NS records inside your DNS doesn't move your DNS.
Spiderz's nameservers are ns1.spiderz.net and ns2.spiderz.net.
CAA
Name: @
Type: CAA
Value: 0 issue "letsencrypt.org"
Limits which certificate authorities may issue certificates for your domain. You don't need one. If you have one, it must include letsencrypt.org, or Spiderz can't issue your free certificate. Let's Encrypt explains CAA
TTL and caching
Other servers keep an answer for up to its TTL. After a change, some visitors see the old answer until their copy expires. Lowering the TTL a day before a planned change makes the switch quicker; lowering it at the same time doesn't, because the old TTL still applies to copies already out there.
Why DNS changes take time explains more.
DNSSEC
DNSSEC signs your DNS records so others can check they're genuine. It's set up between your DNS provider and your registrar. When you move DNS to another provider, turn DNSSEC off first and set it up again afterwards, or your domain can stop working.
Check a record
On a computer with dig:
dig yourdomain.com A +short
dig yourdomain.com AAAA +short
dig www.yourdomain.com CNAME +short
dig yourdomain.com MX +short
dig yourdomain.com TXT +short
dig _dmarc.yourdomain.com TXT +short
Look up the exact name the record is for. An empty answer means there's no record of that type for that name, not that the domain doesn't exist.