SPF Record Generator & 10-Lookup Counter

Generate a deduplicated, RFC 7208 compliant v=spf1 TXT record for AWS SES (1 lookup), Google Workspace (4 lookups), Microsoft 365 (1 lookup), or custom IPv4/IPv6 ranges (0 lookups), or run a live recursive lookup tree audit on any published domain. Spot exactly which nested vendor include: breaks the hard 10-DNS-lookup or 2-void-lookup limit before PermError bounces reach Gmail or Outlook.

SPF Mechanisms & RFC 7208 Lookup Cost Reference

Every v=spf1 record shares a hard ceiling of 10 DNS-querying mechanisms across the entire evaluation chain. Mechanisms that evaluate static IP addresses consume zero lookups, while nested vendor includes add every downstream query to your total.

Mechanism / TagDNS Lookup CostCommon ExampleProduction Guidance
include:1 + nested lookupsinclude:_spf.google.comAudit nested depth; isolate marketing tools on subdomains
redirect=1 + nested lookupsredirect=_spf.example.comReplaces all when delegating full SPF control
a / mx / exists:1 each (+ MX targets)a mxOmit bare a or mx if web/inbound servers never send
ptr1+ (deprecated)ptr:example.comRemove immediately; discouraged by RFC 7208
ip4: / ip6:0 lookupsip4:203.0.113.0/24Zero lookup cost; safe only for static dedicated IPs
~all / -all0 lookups~allUse ~all with DMARC or -all for strict rejection

How This SPF Generator & Lookup Counter Works

In Generate SPF Record mode, the builder assembles a single canonical v=spf1 TXT string directly in your browser, deduplicating shared provider mechanisms (such as AWS SES include:amazonses.com) and estimating total recursive DNS lookups based on each vendor's nested include depth. Static ip4: and ip6: blocks are validated client-side and counted at zero lookups.

In Audit Live Domain SPF mode, our stateless Node.js resolver queries authoritative TXT records in real time without caching. It recursively expands every include: and redirect= branch up to depth 10 with cycle detection, tallies void lookups (NXDOMAIN or empty responses), checks the 255-character TXT string boundary, and ranks top-level mechanisms by total downstream lookup cost.

Frequently Asked Questions

How do I fix an SPF PermError caused by too many DNS lookups?

Start by auditing your live SPF tree in Tab 2 to identify which vendor include: consumes the most lookups. Remove retired providers, strip unused a, mx, and ptr tokens, and move marketing or billing tools onto dedicated sending subdomains such as mail.yourdomain.com so each subdomain gets its own 10-lookup budget.

Should I use ~all (SoftFail) or -all (HardFail) at the end of my SPF record?

Most modern deliverability teams pair ~all with an enforced DMARC policy (p=quarantine or p=reject). Using ~all avoids harsh pre-DMARC bounces on legitimate mailing list forwarders while still signaling unauthorized IPs. Use -all if your domain sends strictly from controlled, non-forwarded infrastructure.

What is an SPF void lookup and why does it matter?

RFC 7208 Section 4.6.4 enforces a second ceiling of 2 void lookups—mechanisms whose DNS query returns NXDOMAIN or zero records. Even if your total lookup count is 4 out of 10, three misspelled or decommissioned include: domains will trigger an immediate PermError.

Can I split a long SPF record into two separate TXT records?

No. Publishing two v=spf1 TXT records at the same hostname invalidates SPF with a PermError. If a single SPF string exceeds 255 characters, keep it inside one DNS TXT record split into multiple quoted 255-character strings (most modern DNS providers like Cloudflare and Route 53 handle this automatically).

Why does Google Workspace take 4 lookups while AWS SES takes 1?

include:_spf.google.com points to an SPF record that itself includes three nested netblock records (_netblocks, _netblocks2, and _netblocks3), totaling 4 DNS lookups. AWS SES (include:amazonses.com) lists its IPv4 ranges directly inside a single TXT record, consuming just 1 lookup.

Related Free Tools

Stateless utilities built by Razix — no signup or email gate required.

All Tools

Deep-Dive Engineering Guides

Practical documentation from the Razix engineering blog.

Razix Multi-Domain Workspace

Stop juggling bloated SPF records across every domain.

Razix gives you unified multi-domain email on AWS SES with a single-lookup SPF footprint, automated DNS verification in under two minutes, and continuous drift alerts.