DNS Record Types

Reference for DNS record types including A, AAAA, CNAME, MX, TXT, and more.

The DNS record types you'll meet when setting up a domain, with each one's numeric code from the IANA registry and what it's for: A and AAAA (IPv4 and IPv6 addresses), CNAME (aliases), MX (mail servers), TXT (verification and email security), NS and SOA (who runs the zone), SRV, CAA, PTR and more. When you change a record, other servers may keep the old answer until its TTL (time to live) runs out, which is why changes can take minutes or hours to show everywhere.

DNS resource record types

TypeCodePurpose
A1IPv4 address of a host
NS2Authoritative name server for the zone
CNAME5Alias of another name (canonical name)
SOA6Start of authority: primary server, contact and timers for the zone
PTR12Pointer for reverse DNS (IP address to name)
HINFO13Host information (CPU and OS)
MX15Mail server for the domain, with priority
TXT16Free text; used for SPF, DKIM, DMARC and domain verification
AAAA28IPv6 address of a host
LOC29Geographic location
SRV33Host and port for a service (e.g. _sip._tcp)
NAPTR35Rewrite rules, used in VoIP/ENUM
DNAME39Alias for a whole subtree of names
DS43DNSSEC delegation signer (hash of a child zone's key)
SSHFP44SSH host key fingerprint
RRSIG46DNSSEC signature over a record set
NSEC47DNSSEC proof that a name doesn't exist
DNSKEY48DNSSEC public key
NSEC350DNSSEC hashed proof of non-existence
TLSA52Certificate association for DANE
SVCB64Service binding: endpoints and parameters for a service
HTTPS65Service binding for HTTPS (ALPN, ECH, address hints)
SPF99Obsolete: publish SPF in TXT records instead
CAA257Which certificate authorities may issue certificates for the domain

Source: IANA DNS Parameters registry.

Common use cases

  • Work out which record to add for a website, email or verification
  • Read a DNS lookup or zone file
  • Set up SPF, DKIM and DMARC for email
  • Look up a record's numeric type code

How to use

  1. Find the record type in the first column.
  2. Read what it's used for.
  3. Use the code column when a tool or packet capture shows types as numbers.

FAQ

What's the difference between an A record and a CNAME?

An A record points a name straight at an IPv4 address. A CNAME points a name at another name, which is then looked up in turn. Use AAAA for IPv6 addresses.

Can I put a CNAME on my root domain?

Not under the DNS rules, because the root (example.com) must also hold NS and SOA records and a CNAME can't share a name with other records. Many DNS providers offer ALIAS, ANAME or CNAME flattening to get the same effect.

What do the numbers on MX records mean?

They're priorities. Mail goes to the server with the lowest number first, and to higher numbers only if it can't be reached.

Which records do I need for email security?

SPF, DKIM and DMARC, all published as TXT records. SPF lists the servers allowed to send for your domain, DKIM publishes the key used to sign messages, and DMARC tells receivers what to do when the checks fail.