Audit DNS records across every zone for drift
When to use: You own 40 zones and want to know which have weird TTLs, missing SPF/DMARC, or dangling CNAMEs.
Prerequisites
- API token with
Zone:Zone:Read,Zone:DNS:Read— Cloudflare dashboard → My Profile → API Tokens → Create
Flow
-
List zones and count records per typeList all zones in my account. For each, count records by type (A, CNAME, TXT, MX).✓ Copied→ Inventory matrix
-
Check email-auth hygieneFor each zone used for email, check presence of SPF (TXT containing 'v=spf1'), DMARC TXT at _dmarc, and DKIM selector TXT records. Flag missing.✓ Copied→ Email-auth gap report
-
Find dangling CNAMEsFor each CNAME in every zone, resolve the target. Flag NXDOMAIN or SERVFAIL as dangling.✓ Copied→ List of risky CNAMEs
Outcome: A zone-by-zone DNS hygiene report you can hand to the team that owns each domain.
Pitfalls
- Dangling CNAMEs are subdomain-takeover risks — Any NXDOMAIN CNAME gets escalated immediately — delete or fix