Skip to content

/codes/dns/dns-record-types

DNS record types list: A, AAAA, CNAME, MX, TXT, NS, SOA, SRV, CAA, HTTPS and their numbers

verified onenvironmentlocal · windows 10.0.26200 arm64 · GNU bash 5.3.15 (Git Bash)updated
tool
DNS
versions
RFC 1035, IANA DNS parameters
os
any

Every DNS resource record has a type, a 16-bit number registered by IANA, with a mnemonic used in zone files and tools (A is 1, AAAA is 28, MX is 15). The type decides what the record data contains: an IPv4 address, a host name, a mail server with a priority, free text. The table lists the types you meet in practice; the IANA registry has the full list.

Common record types

TypeNumberContainsExample data
A1IPv4 address192.0.2.10
NS2Authoritative name server for the zonens1.example.com.
CNAME5Alias: the canonical name to look up insteadapp.example.net.
SOA6Start of authority: primary server, contact, serial, timersns1 hostmaster 2026102101 7200 3600 1209600 3600
PTR12Reverse lookup: name for an address (in in-addr.arpa / ip6.arpa)host.example.com.
MX15Mail server with a preference (lower wins)10 mail.example.com.
TXT16Free text: SPF, DKIM, DMARC, domain verification"v=spf1 -all"
AAAA28IPv6 address2001:db8::10
SRV33Service location: priority, weight, port, target10 5 5060 sip.example.com.
NAPTR35Rewrite rules (SIP, ENUM)100 10 "U" "E2U+sip" "!^.*$!sip:info@example.com!" .
DS43DNSSEC: hash of the child zone key, stored in the parent12345 13 2 (hex digest)
RRSIG46DNSSEC signature over a record set(signature data)
DNSKEY48DNSSEC public key of the zone257 3 13 (base64 key)
TLSA52DANE: certificate association for a TLS service3 1 1 (hex digest)
SVCB64Service binding: endpoints and parameters for a service1 svc.example.net. alpn=h2
HTTPS65SVCB for HTTPS: ALPN, ports, ECH, works at the zone apex1 . alpn=h3,h2
CAA257Which certificate authorities may issue for the name0 issue "letsencrypt.org"

Check the numbers

The dnspython library carries the IANA table; this prints the number for each mnemonic:

bash
uv run -q --no-project --python 3.13 --with dnspython==2.8.0 python - <<'EOF'
import dns.rdatatype as t
for name in ["A", "NS", "CNAME", "SOA", "PTR", "MX", "TXT", "AAAA", "SRV", "NAPTR", "DS", "RRSIG", "DNSKEY", "TLSA", "SVCB", "HTTPS", "CAA"]:
    print(f"{name:7} {t.from_text(name).value}")
EOF

Output

A       1
NS      2
CNAME   5
SOA     6
PTR     12
MX      15
TXT     16
AAAA    28
SRV     33
NAPTR   35
DS      43
RRSIG   46
DNSKEY  48
TLSA    52
SVCB    64
HTTPS   65
CAA     257

Notes

  • Types without a mnemonic in a tool can be written generically as TYPE65 (RFC 3597), for example dig example.com TYPE65.
  • ANY (255) is a query type, not a record type; many servers now answer it with a minimal response (RFC 8482).
  • SPF (99) as a separate type is deprecated: publish SPF policies in TXT records.
  • A name that has a CNAME cannot have other record types (except DNSSEC ones), which is why the zone apex cannot be a CNAME.

Sources