SPF 10-Lookup Tree Analyzer, Deterministic Flattener & MTA-STS Policy Generator

Diagnose RFC 7208 Section 4.6.4 PermError (>10 DNS-querying mechanisms), flatten vendor includes into deterministic IPv4/IPv6 CIDRs, and generate RFC 8461 MTA-STS + RFC 8460 TLS-RPT configurations.

⚡ 1-Click Live Diagnostic • Zero Login • <1.5s Edge Execution

Run a Live Deterministic Check Right Now

Scan real corporate DNS via Cloudflare DoH, simulate a broken AI-agent OpenAPI PR, or audit WCAG 2.2 / EN 301 549 clauses instantly.

1-Click Real DNS Presets:
Click Scan Live DNS & Flatten SPF or any preset above to query live TXT records via Cloudflare DoH (cloudflare-dns.com/dns-query) and compute your exact X / 10 DNS Lookups (RFC 7208) score.

Why RFC 7208 Section 4.6.4 Breaks Modern SaaS Email Deliverability

Under RFC 7208 Section 4.6.4, any SPF record that triggers more than 10 DNS-querying mechanisms (include, a, mx, ptr, exists, redirect) must return permerror. Modern B2B stacks stacking Google Workspace (4 lookups), HubSpot (3 lookups), SendGrid (2 lookups), and AWS SES or Mailgun routinely breach this ceiling—silently breaking DMARC alignment.

SPFGuard inspects your lookup tree, collapses recursive third-party include: chains into zero-lookup ip4: and ip6: CIDR primitives, and generates your compliant MTA-STS (RFC 8461) and TLS-RPT (RFC 8460) policy records.

Interactive SPF 10-Lookup Analyzer & Deterministic Flattener

Enter your domain and current SPF TXT record below to calculate total recursive DNS lookups, generate a flattened record, and build an MTA-STS policy bundle:

View spfguard-cli on GitHub
Click "Analyze & Flatten SPF + Generate MTA-STS" to inspect lookup count and flattened CIDR record.

Common SaaS ESP Lookup Consumption Reference

Provider / Mechanism SPF Include Target Typical Recursive Lookups Flattened Lookup Cost
Google Workspace include:_spf.google.com 3 to 4 DNS lookups 0 lookups (ip4/ip6 CIDRs)
Microsoft 365 / Exchange Online include:spf.protection.outlook.com 1 to 2 DNS lookups 0 lookups (ip4/ip6 CIDRs)
Twilio SendGrid include:sendgrid.net 1 to 2 DNS lookups 0 lookups (ip4/ip6 CIDRs)
Mailgun / Mailchimp include:mailgun.org / include:servers.mcsv.net 2 to 3 DNS lookups 0 lookups (ip4/ip6 CIDRs)

Operational Note: Static flattened SPF records require periodic re-synchronization because cloud email providers rotate IP blocks. Use spfguard-cli in scheduled GitHub Actions or upgrade to Starter ($19/mo) / Team ($39/mo) for automated CI drift alerts.

10-Second Onboarding Builder • Zero Docker

Generate Your Drop-In CI/CD or .pre-commit Config in 10 Seconds

Select your CI stack, deterministic gates, and repository scale to generate ready-to-commit YAML.

2. Deterministic Gates to Enforce
.github/workflows/specgate.yml
name: SpecGate Deterministic CI Gates
on: [pull_request]
jobs:
  deterministic-gates:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: profalexandrezamboni-ui/specgate-action@v1.2.0
        env:
          SPECGATE_API_KEY: ${{ secrets.SPECGATE_API_KEY }}
        with:
          base_spec: openapi/base.json
          head_spec: openapi/head.json
      - run: pipx run --spec git+https://github.com/profalexandrezamboni-ui/spfguard-cli@v1.2.0 spfguard-cli --domain example.com
Recommended for 3–15 Repositories: Starter Plan ($19/mo flat team rate) unlocks SPECGATE_API_KEY for up to 15 private/public repos, automated inline PR comments, and 1,000 checks/hr.

Transparent Pricing — Instant Activation via Paddle

Start free on up to 2 repositories or domains. Upgrade anytime for multi-repository governance, signed PR overrides, and compliance exports.

Free Open-Source

$0/mo
  • Up to 2 repositories / domains
  • Deterministic CLI & GitHub Action
  • Interactive Web Playground
  • 60 API requests/hour
Install from GitHub

Team & Compliance

$39/mo

Paddle Price ID: pri_01m72s8sgdake5vfj2ygs54x50

  • Unlimited repositories & domains
  • Auditable PR Sign-Off override workflow
  • SOC 2 Audit Trail & EN 301 549 exports
  • 10,000 API requests/hour
Subscribe Team — $39/mo

14-Day Self-Serve Refund Guarantee: Payments, sales tax, and VAT are handled by our Merchant of Record (Paddle). Cancel immediately or trigger an automated 14-day full refund anytime via POST /api/v1/support/ticket.

Frequently Asked Technical Questions

What causes 'SPF PermError: Too Many DNS Lookups' under RFC 7208?

RFC 7208 Section 4.6.4 strictly limits SPF evaluation to at most 10 DNS-querying mechanisms and modifiers (include, a, mx, ptr, exists, redirect). When a domain combines Google Workspace, Microsoft 365, SendGrid, HubSpot, or Zendesk, nested includes quickly exceed 10 lookups, causing receiving mail servers to fail SPF with a permanent error (PermError) and drop or quarantine legitimate emails.

Which SPF mechanisms count toward the 10-lookup limit?

Mechanisms 'include', 'a', 'mx', 'ptr', 'exists', and the 'redirect' modifier count toward the 10-lookup ceiling, including all recursive lookups inside included third-party records. 'ip4', 'ip6', and 'all' require zero DNS lookups.

Why combine SPF flattening with MTA-STS (RFC 8461)?

While SPF authenticates outbound sender IPs, MTA-STS (RFC 8461) and TLS-RPT (RFC 8460) enforce mandatory TLS encryption and certificate validation for inbound SMTP traffic, preventing downgrade and man-in-the-middle attacks.