Audit DNS records across every zone for drift
Wann einsetzen: You own 40 zones and want to know which have weird TTLs, missing SPF/DMARC, or dangling CNAMEs.
Voraussetzungen
- API token with
Zone:Zone:Read,Zone:DNS:Read— Cloudflare dashboard → My Profile → API Tokens → Create
Ablauf
-
List zones and count records per typeList all zones in my account. For each, count records by type (A, CNAME, TXT, MX).✓ Kopiert→ 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.✓ Kopiert→ Email-auth gap report
-
Find dangling CNAMEsFor each CNAME in every zone, resolve the target. Flag NXDOMAIN or SERVFAIL as dangling.✓ Kopiert→ List of risky CNAMEs
Ergebnis: A zone-by-zone DNS hygiene report you can hand to the team that owns each domain.
Fallstricke
- Dangling CNAMEs are subdomain-takeover risks — Any NXDOMAIN CNAME gets escalated immediately — delete or fix