December 4, 2026

DNS Records Explained: A, AAAA, CNAME, MX, TXT and CAA, Served From a Real Test Zone

A card catalog drawer pulled open with tabbed index cards

Every domain’s DNS settings page offers the same short menu of record types, and most domain problems come from picking the wrong one: a CNAME where an A record belongs, an MX that points at an alias, a second SPF record that cancels the first. To show each type exactly as a resolver sees it, a small zone for the reserved test domain example.test was loaded into a BIND 9.18 name server on Ubuntu 24.04 and queried with dig. The zone checker was also fed three broken zones, to see which mistakes the software itself refuses.

Video: PowerCert Animated Videos on YouTube

The test zone

Every common type in one file

$TTL 3600
@       IN SOA  ns1.example.test. admin.example.test. ( 2026051001 7200 900 1209600 300 )
@       IN NS   ns1.example.test.
ns1     IN A    192.0.2.53
@       IN A    192.0.2.10
@       IN AAAA 2001:db8::10
www     IN CNAME example.test.
shop    IN CNAME shops.example-host.net.
@       IN MX   10 mail.example.test.
@       IN MX   20 backup-mail.example.test.
mail    IN A    192.0.2.25
@       IN TXT  "v=spf1 mx -all"
_dmarc  IN TXT  "v=DMARC1; p=quarantine"
@       IN CAA  0 issue "letsencrypt.org"

The @ stands for the domain itself, example.test. Names without a trailing dot, like www, are relative to it. Names with one, like example.test., are complete. The addresses come from ranges reserved for documentation, so nothing here points at a real machine.

What the checker said

named-checkzone loaded it and raised one warning on its own:

zone example.test/IN: example.test/MX 'backup-mail.example.test' has no address records (A or AAAA)

The backup mail server was named but never given an address. The zone still loaded. A mail server trying that backup would have had nowhere to deliver.

Rows of colorful ring binders on wooden shelves

A and AAAA: name to address

The basic lookup

$ dig @127.0.0.1 -p 5353 +noall +answer example.test A
example.test.       3600    IN  A   192.0.2.10

$ dig @127.0.0.1 -p 5353 +noall +answer example.test AAAA
example.test.       3600    IN  AAAA    2001:db8::10

An A record maps a name to an IPv4 address. AAAA does the same for IPv6: RFC 3596 describes it as a record that stores a single IPv6 address. A name can have both, and a device with IPv6 connectivity will usually prefer the AAAA.

The 3600

The number in every answer is the TTL. RFC 1034 defines it as the time to live of the RR, a 32-bit number of seconds used mainly by resolvers when they cache records. Here, 3,600 seconds: a resolver that looked this name up may keep giving out 192.0.2.10 for an hour, even if the record is changed one minute later. That is why DNS changes seem to “propagate” slowly. Nothing is propagating; caches are expiring.

CNAME: one name pointing at another

What dig returned

$ dig @127.0.0.1 -p 5353 +noall +answer www.example.test A
www.example.test.   3600    IN  CNAME   example.test.
example.test.       3600    IN  A   192.0.2.10

The query asked for an address for www. The server answered with two records: www is an alias for example.test, and example.test has this address. The resolver follows the chain.

The rule that defines it

RFC 1034 sets the one rule that governs every CNAME: if a CNAME RR is present at a node, no other data should be present. The RFC gives two reasons. It ensures the data for a canonical name and its aliases cannot differ. And it means a resolver holding a cached CNAME can use it without checking back with an authoritative server for other record types at that name, because there cannot be any. Both reasons are about consistency: an alias is supposed to be a pure pointer, carrying nothing of its own that could disagree with the name it points to.

The zone checker enforces it. A zone with both a CNAME and a TXT record on www:

zone example.test/IN: loading from master file both.zone failed: CNAME and other data
zone example.test/IN: not loaded due to errors.

No CNAME at the top of a domain

The same rule explains why the bare domain cannot be a CNAME. The apex always carries an SOA and NS records. A test zone that tried @ IN CNAME other.example.net. failed in the same way, “CNAME and other data,” and was not loaded. This is the reason hosting services that hand out a hostname, rather than an IP address, need a workaround for the root of the domain. Several DNS providers offer their own pseudo-record for this, under names such as ALIAS or ANAME; those are provider features, resolved on their side, not standard record types.

Mail

MX: where the mail goes

Preference numbers

$ dig @127.0.0.1 -p 5353 +noall +answer example.test MX
example.test.       3600    IN  MX  10 mail.example.test.
example.test.       3600    IN  MX  20 backup-mail.example.test.

Each MX record names a mail server and a number. RFC 1035 defines the number as a preference among records for the same name, and states that lower values are preferred. Mail goes to mail first and to backup-mail only if that fails. Equal numbers share the load.

An MX must not point at an alias

RFC 2181 settles a common question: the domain name in an MX record must not be an alias, and it must have one or more address records. The RFC adds that pointing it at an alias “neither works as well as might be hoped.” The same applies to NS records.

BIND’s checker accepted a test zone whose MX did point at a CNAME, without a warning. The software tolerating it is not the same as the standard allowing it. Mail servers that follow the RFC strictly may refuse to deliver.

TXT: text that other systems read

SPF and DMARC

$ dig @127.0.0.1 -p 5353 +noall +answer example.test TXT
example.test.       3600    IN  TXT "v=spf1 mx -all"

$ dig @127.0.0.1 -p 5353 +noall +answer _dmarc.example.test TXT
_dmarc.example.test.    3600    IN  TXT "v=DMARC1; p=quarantine"

RFC 1035 describes TXT records as holding descriptive text whose meaning depends on the domain where it is found. Today that text is mostly instructions for machines. The SPF record above says: mail from this domain may come from the servers listed in its MX records, and from nowhere else.

RFC 7208, the SPF standard, is specific about the format: SPF records MUST be published as a DNS TXT (type 16) Resource Record only. A separate SPF record type existed during SPF’s experimental phase and has been discontinued.

The DMARC record lives at its own name, _dmarc, which is why it does not collide with the SPF record at the apex.

One SPF record, not two

A domain that adds a second v=spf1 TXT record when it signs up for a new email service, instead of merging it into the first, ends up with two. Receivers that follow the SPF rules then treat the policy as an error rather than picking one. Merging into a single record, v=spf1 mx include:... -all, is the fix.

Clear hourglass

CAA, NS and SOA

CAA: which certificate authorities may issue

$ dig @127.0.0.1 -p 5353 +noall +answer example.test CAA
example.test.       3600    IN  CAA 0 issue "letsencrypt.org"

RFC 8659 describes the CAA record as letting a domain holder specify one or more Certification Authorities (CAs) authorized to issue certificates for the domain. Public CAs check it before issuing. With this record, a certificate request for example.test at any other CA should be refused.

NS and SOA

The NS record names the server that is authoritative for the zone, here ns1.example.test, with its own A record. The SOA record at the top holds the zone’s serial number and timers. Its last number matters more than it looks. When a name does not exist, the server says so and attaches the SOA:

$ dig @127.0.0.1 -p 5353 nope.example.test A
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN
example.test.       300 IN  SOA ns1.example.test. admin.example.test. 2026051001 7200 900 1209600 300

The TTL on that SOA was 300, not the zone’s usual 3,600: the server used the last SOA value, five minutes, as the lifetime for the “does not exist” answer. A name looked up before it was created stays “not found” in resolvers’ caches for that long, which explains a new subdomain that works for some people and not others for a few minutes after it is added.

Quick reference

Record Holds Common mistake
A IPv4 address Changing it without lowering the TTL first
AAAA IPv6 address Leaving a stale one after moving hosts; IPv6 users break
CNAME Another name Putting one at the apex, or next to other records
MX Mail server name and preference Pointing at a CNAME; naming a host with no address
TXT Text, mostly SPF, DMARC and verification tokens Two separate SPF records
CAA Which CAs may issue certificates Forgetting the CA actually in use
NS Authoritative servers Mismatch between registrar and zone

Sources

  • RFC 1034, “Domain Names: Concepts and Facilities”: https://www.rfc-editor.org/rfc/rfc1034.html
  • RFC 1035, “Domain Names: Implementation and Specification”: https://www.rfc-editor.org/rfc/rfc1035.html
  • RFC 2181, “Clarifications to the DNS Specification”: https://www.rfc-editor.org/rfc/rfc2181.html
  • RFC 3596, “DNS Extensions to Support IP Version 6”: https://www.rfc-editor.org/rfc/rfc3596.html
  • RFC 7208, “Sender Policy Framework (SPF)”: https://www.rfc-editor.org/rfc/rfc7208.html
  • RFC 8659, “DNS Certification Authority Authorization (CAA) Resource Record”: https://www.rfc-editor.org/rfc/rfc8659.html

719 Posts

Peter Kalafatis writes and edits X9M8. He holds a bachelor's degree from LIU Post and a master's in Media Studies from The New School, with academic work in the philosophy of science, human behavior, AI, and memetics.

View All Posts

Leave a Reply

Your email address will not be published. Required fields are marked *