Guides · DNS · Updated

DNS record types explained

A DNS record is one fact about a domain: where its website lives, where its mail goes, who runs its nameservers. Each fact has a type. Ten of them cover almost everything you will meet, and eight have a page here with the format, an example and a live lookup.

Look up any record type

Pick a type and see what resolvers around the world return:

The common types at a glance

TypePoints toTypical useExample value
AAn IPv4 addressThe address of a website or server203.0.113.10
AAAAAn IPv6 addressThe same, over IPv62001:db8::10
CNAMEAnother nameMake www or a subdomain an alias of a hostcdn.example.net
MXA mail server name, with a priorityWhere email for the domain is delivered10 mail.example.com
TXTFree textSPF, DKIM, DMARC and site verificationv=spf1 -all
NSA nameserver nameWhich servers hold the domain's recordsns1.example.net
SOAZone detailsPrimary server, contact, serial number and timersns1.example.net hostmaster.example.com 2026110801 …
PTRA hostname, for an IP addressReverse lookups, mostly for mail serversmail.example.com
SRVHost, port, priority and weightFind the server for a service such as SIP or XMPP10 5 5060 sip.example.com
CAAA certificate authorityLimit who may issue TLS certificates for the domain0 issue "letsencrypt.org"

Rules that cause the most trouble

  • A CNAME can't share a name with another record. That includes the root of a domain, which always has SOA and NS records. Use an A record there, or your DNS host's ALIAS/ANAME feature if it has one.
  • MX and NS must point to names, not addresses, and the name must have an A or AAAA record of its own. An MX that points to a CNAME is invalid.
  • A domain should have exactly one SPF record. SPF lives in a TXT record, and two of them make SPF fail. See SPF record syntax.
  • More than one A record is fine. Resolvers return them all, and clients pick one, which spreads traffic crudely.

Which record for which job

  • Put a website on a server: an A record (and AAAA if the server has IPv6).
  • Point a subdomain at a hosting or CDN service: a CNAME to the name the service gives you.
  • Receive email: MX records. Prove your mail is genuine: TXT records for SPF, DKIM and DMARC.
  • Move DNS to another provider: change the NS records at your registrar.
  • Make your mail server look legitimate: a PTR record on its IP address, set by whoever owns the address. See reverse DNS lookup.

Every record also has a TTL, and a change takes as long as the old TTL to reach everyone, as explained in how long DNS propagation takes.

Frequently asked questions

What are the most common DNS record types?

A and AAAA (addresses), CNAME (aliases), MX (mail), TXT (text, including SPF and DMARC), NS (nameservers) and SOA (zone information). PTR, SRV and CAA are less common but important in their niches.

What is the difference between an A record and a CNAME?

An A record maps a name straight to an IPv4 address. A CNAME maps a name to another name, and the lookup continues from there. A CNAME cannot share its name with any other record.

Can a domain have more than one record of the same type?

Yes for most types. Several A records spread traffic across servers, and several MX records give mail servers a fallback order. Some rules apply: a name has only one CNAME, and a domain should publish only one SPF record.

Which record do I need for email?

MX records say where mail is delivered. TXT records carry the SPF, DKIM and DMARC settings that prove mail is genuine. A PTR record on the sending server's IP address helps with deliverability.