How a zone gets snapshotted
There is an awkward fact at the centre of this design: from outside, you generally cannot list what is in a DNS zone. You can only ask about names you already know. So the first job is knowing which names to ask about, and it turns out you have four sources for that.
Key takeaways
- You cannot enumerate a zone from outside. The name list is assembled from four sources.
- Certificate transparency is the best single source of hostnames you actually use.
- Query a fixed set of record types per name, not everything.
- Two resolvers, and a change is only a change when both agree.
- A name that stops resolving is as important as one that changes.
Building the name list
- Machine learning
- Networking
- Security & identity
- Analytics
- Outside AWS
Where a provider API exists, use it
If your zones are in Route 53, or any provider with a list-records API, that is the complete answer and the enumeration problem disappears. Read the zone, snapshot every record, done. Most small businesses have at least one zone like this and at least one that is somewhere else entirely.
Even then, the resolved check is still worth running alongside it, because a zone that is correct in the provider and not authoritative in the real world is precisely the failure the API view cannot show you.
The obvious names
A fixed list that costs nothing to check and catches a surprising amount: the apex, www, mail, autodiscover, _dmarc, _domainkey and the selectors your mail provider uses, and _acme-challenge. The last one is worth watching for an unusual reason: a validation record that has been left in place long after a certificate was issued is an untidiness, and one that appears when nobody is issuing a certificate is not.
Which record types
| Type | Why | Where |
|---|---|---|
| A / AAAA | Where a name points | Every name |
| CNAME | What a name aliases | Every name |
| MX | Where mail goes | Apex and any mail subdomain |
| TXT | SPF, DMARC, verification tokens | Apex, _dmarc, selectors |
| NS | Who is authoritative | Apex and any delegated subdomain |
| CAA | Who may issue certificates | Apex |
CAA is the one most people leave out and it is cheap to include. A CAA record that changes, or one that disappears, changes who is allowed to issue a certificate for your domain, and that is worth a message.
Two resolvers
- Machine learning
- Networking
- Management
Requiring both resolvers to agree before calling something a change removes almost all propagation noise at the cost of one extra query per name and up to an hour of delay. For a critical record that delay is unwelcome, so critical records use a third resolver and alarm on two out of three — faster, and still not fooled by one stale cache.
Disappearance
A name that resolved yesterday and does not today is a change, and it is one that a naive diff on record contents will miss entirely. It is also, in practice, more likely to be a real problem than a modification: records get deleted during tidy-ups far more often than they get maliciously edited.
Next: how a change gets described.
All posts