The Hidden SPF Void Lookup Limit (RFC 7208): Why a 4/10 Record Still Fails With PermError
Most engineers know about the 10 DNS lookup limit in SPF (RFC 7208). You count your include: mechanisms, see 4/10 or 6/10, and assume your SPF record is healthy.
Then outbound emails start failing authentication with PermError—even though you're nowhere near 10 lookups.
The culprit is often RFC 7208 Section 4.6.4: the void lookup limit.
What Counts as a "Void Lookup"?
During SPF evaluation, a receiving mail server treats a DNS lookup as void when a lookup mechanism (include:, a, mx, ptr, exists:) returns:
-
NXDOMAIN(the domain or record doesn't exist), or - A
NODATA/ empty response with zero matching records.
Under RFC 7208 Section 4.6.4, more than 2 void lookups during a single SPF evaluation aborts evaluation and returns permerror.
That means a record with only 4 total DNS lookups can still fail if 3 of those lookups are void.
How Void Lookups Sneak Into Real DNS Zones
In practice, void lookups rarely come from someone typing garbage on purpose. They usually show up because of day-to-day drift:
- Retired SaaS & marketing tools: A vendor gets deprecated or an old
include:for a discontinued campaign tool is left behind in the root TXT record. - Stale subdomain or
mx/amechanisms: An old mail host or subdomaina:tag gets decommissioned in DNS, leaving an orphan reference in SPF. - Misconfigured vendor sub-records: A nested
include:points to a host that returnsNXDOMAINor an empty TXT answer under certain query paths.
Why Surface Checks Miss It
Basic SPF checkers only count top-level mechanisms or stop at the first syntax error. They often show 4/10 or 5/10 and give you a false green light while hiding 3 void lookups buried inside the evaluation chain.
To catch it properly, you have to walk the full recursive expansion and inspect the DNS response status (NOERROR vs. NXDOMAIN / empty answer) on every lookup step—not just tally include: count.
How to Fix and Prevent It
- Audit every lookup's DNS response, not just the total count: Remove dead
include:,a:, ormx:entries that returnNXDOMAINor empty answers. - Keep a buffer below both ceilings: Don't run right up against either the 10-lookup limit or the 2-void-lookup limit as vendors change their DNS.
- Flatten and keep CIDRs in sync: Resolving nested includes into IP ranges eliminates recursive hops, provided your flattened record stays updated when vendors rotate IPv4/IPv6 ranges.
If you want to inspect the full recursive lookup chain and void-lookup count on a live domain without signing up, I built a free scanner at SPF1.