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
| Type | Code | Purpose |
|---|---|---|
| A | 1 | IPv4 address of a host |
| NS | 2 | Authoritative name server for the zone |
| CNAME | 5 | Alias of another name (canonical name) |
| SOA | 6 | Start of authority: primary server, contact and timers for the zone |
| PTR | 12 | Pointer for reverse DNS (IP address to name) |
| HINFO | 13 | Host information (CPU and OS) |
| MX | 15 | Mail server for the domain, with priority |
| TXT | 16 | Free text; used for SPF, DKIM, DMARC and domain verification |
| AAAA | 28 | IPv6 address of a host |
| LOC | 29 | Geographic location |
| SRV | 33 | Host and port for a service (e.g. _sip._tcp) |
| NAPTR | 35 | Rewrite rules, used in VoIP/ENUM |
| DNAME | 39 | Alias for a whole subtree of names |
| DS | 43 | DNSSEC delegation signer (hash of a child zone's key) |
| SSHFP | 44 | SSH host key fingerprint |
| RRSIG | 46 | DNSSEC signature over a record set |
| NSEC | 47 | DNSSEC proof that a name doesn't exist |
| DNSKEY | 48 | DNSSEC public key |
| NSEC3 | 50 | DNSSEC hashed proof of non-existence |
| TLSA | 52 | Certificate association for DANE |
| SVCB | 64 | Service binding: endpoints and parameters for a service |
| HTTPS | 65 | Service binding for HTTPS (ALPN, ECH, address hints) |
| SPF | 99 | Obsolete: publish SPF in TXT records instead |
| CAA | 257 | Which 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
- Find the record type in the first column.
- Read what it's used for.
- 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.
Related tools
- HTTP Status CodesComplete reference of HTTP status codes with meanings and use cases.
- Port Number LookupCommon network port numbers and their associated services.
- SMTP Status CodesEmail server response codes and their meanings for troubleshooting.
- File Extension LookupFile extension database with associated programs and MIME types.
- MIME Type LookupMIME type reference for content type headers and file handling.
- MAC Address Vendor LookupFind the manufacturer behind a MAC address from the IEEE registry, spot randomised addresses, and convert MAC…
- WHOIS LookupIn Utilities
- DNS LookupIn Utilities