DNS and Domains field notes

Fix DNS records, email authentication, DNSSEC, and certificates with confidence

A working library of the DNS and domain problems that break real sites and email, across records, nameservers, email authentication, DNSSEC, certificates, and takeover risk, with the exact records and commands to fix each one. Every guide has a diagram of the problem, a diagram of the fix, the records and commands to apply and to verify, and links to the sources. Where a DNS provider API can do it, there is a small Python and Node.js script too.

Python and Node.js dig, dnspython, Cloudflare API Diagrams and full code All code on GitHub

Nameserver / Delegation

4 guides

Core Records

8 guides

Missing A or AAAA record causes NXDOMAIN

Hosted zone lacks an address record for the queried name. Script resolves the name and reports the missing record.

Diagnostic

CNAME at zone apex conflicts with NS or SOA

A literal CNAME at the root breaks required apex records. Script detects apex CNAME and confirms flattening resolved correctly.

Repair

CNAME coexists with another record type at same name

A CNAME shares a hostname with MX, TXT, or A records, which is invalid. Script scans the zone for coexistence violations.

Diagnostic

Duplicate or conflicting records for the same name

Two A records or a CNAME plus another type exist at one name causing undefined resolution. Script fetches the record set and flags duplicates.

Diagnostic

CNAME to A record type change fails on existing RRSet

Converting a CNAME to an A record fails unless the old record is deleted first. Script orders deletes before creates when reconciling.

Repair

www and apex configured inconsistently

Only www or only apex is set up, so the other variant fails to resolve or serves different content. Script resolves both and compares.

Reconciler

Wildcard record creates unintended catch-all exposure

A broad wildcard resolves every undefined subdomain, masking typos or takeovers. Script enumerates wildcard scope and flags apex-level wildcards.

Diagnostic

Hosting provider DNS check fails custom domain setup

Apex A records or CNAME target do not match the host's required values (e.g. GitHub Pages). Script checks records against the provider's published values.

Reconciler

Security / Takeover Risk

6 guides

TLS Certificates / CAA

5 guides

DNSSEC

6 guides

Email Authentication

10 guides

SPF exceeds the 10 DNS lookup limit

Nested include mechanisms push SPF evaluation past 10 lookups, causing PermError. Script recursively counts lookups and flags overage.

Diagnostic

Duplicate SPF TXT records on one domain

Two separate v=spf1 TXT records exist, which must be treated as PermError. Script queries TXT records and counts SPF-prefixed entries.

Repair

SPF record has duplicate or misplaced all mechanism

Two all directives in one SPF record break evaluation order. Script parses the SPF record and flags duplicate or misordered mechanisms.

Diagnostic

DKIM selector record missing or not propagated

The selector._domainkey record is absent or stale, so signatures cannot verify. Script queries expected selector names and flags absence.

Diagnostic

Required DKIM CNAME selectors not published

Some providers expect CNAME records for selectors and rotation stalls if missing. Script checks that both selectors resolve as CNAMEs to the provider's target.

Reconciler

DKIM TXT record malformed or wrapped in quotes

A copy-pasted or unsplit long key invalidates the public key value. Script fetches the TXT record and validates the key parses correctly.

Diagnostic

DKIM public key stale after rotation

DNS still publishes the old public key after a private key rotation, so signatures fail. Script diffs the deployed key against the published TXT.

Reconciler

DMARC record missing or malformed

The _dmarc TXT record is absent or missing required tags. Script fetches the record and validates syntax against DMARC tag grammar.

Diagnostic

DMARC stuck at policy none indefinitely

A domain never progresses past monitor-only policy, leaving it unprotected from spoofing. Script parses the DMARC record and flags p=none.

Diagnostic

DMARC aggregate reports never arrive

The rua destination lacks the required third-party authorization record on a different domain. Script checks both the DMARC record and the external auth TXT record.

Diagnostic

Mail Routing

5 guides

TTL / Propagation

5 guides

Domain Lifecycle

3 guides

Provider API / Reconciliation

6 guides

Fighting a DNS or email deliverability problem right now?

If you have a DNS, email authentication, DNSSEC, or certificate problem you would rather hand off, this is the kind of work I do. Message me and we can work through it together.

Contact me on LinkedIn

Found this useful?

These guides are free and always will be. If one saved you a support ticket or a refund, you can throw a coffee my way. It keeps the notes coming.

Buy me a coffee on Ko-fi