Fix SPF Void Lookups Limit Exceeded (>2 NXDOMAIN or Empty DNS Answers)

Why dead SaaS includes and non-existent A/MX mechanisms trigger RFC 7208 §4.6.4 PermError after just 2 void lookups, even when total lookups are under 10.

RFC 7208 §4.6.4 (Void Lookups Limit of 2)RFC 7208 §11.1 (Denial-of-Service amplification mitigation)

Incident Symptom & RFC 7208 Root Cause

SMTP & Deliverability Symptom

An SPF record with only 5 total mechanisms (well below the 10-lookup ceiling!) unexpectedly fails SPF authentication at strict receivers with spf=permerror (too many void lookups).

DNS Resolver & RFC 7208 Mechanics

To stop attackers from abusing SPF parsers for NXDOMAIN DNS amplification attacks, RFC 7208 §4.6.4 specifies a SEPARATE counter for 'void lookups': any DNS query triggered by an SPF mechanism/modifier that returns either RCODE 3 (NXDOMAIN) or RCODE 0 (NOERROR) with 0 answer records. Exceeding 2 void lookups returns PermError!

Broken vs Verified DNS Configuration

BrokenSPF Record with 3 Void Lookups (Only 5 Total Lookups, Still PermError!)
; Total lookups = 5 (<= 10), YET void lookups = 3 (> 2) -> PermError!
; 1. 'a' on a domain with no root A/AAAA record (only www CNAME exists) -> Void #1 (NODATA)!
; 2. 'include:spf.defunct-startup-crm.io' (expired domain) -> Void #2 (NXDOMAIN)!
; 3. 'include:_spf.typo-mailer.com' (DNS typo) -> Void #3 (NXDOMAIN) -> PermError!
example.com. 3600 IN TXT "v=spf1 a include:_spf.google.com include:spf.defunct-startup-crm.io include:_spf.typo-mailer.com -all"
Verified FixZero-Void-Lookup Audited SPF Record
; Removed 'a' (apex has no A record) and purged dead/typo vendor includes!
; Total lookups = 4, Void lookups = 0!
example.com. 3600 IN TXT "v=spf1 include:_spf.google.com -all"

Protocol Mechanics & Operational Deep Dive

Many DNS linters check only the 10-mechanism limit and completely miss the 2-void-lookup fuse in the second paragraph of RFC 7208 §4.6.4: 'SPF implementations SHOULD limit void lookups to two. An implementation MAY choose to make such a limit configurable. In this case, a default of two is RECOMMENDED. Exceeding the limit produces a permerror result.' Major mailbox providers including Google, Yahoo, and rspamd/SpamAssassin enforce this 2-void limit in production.

Notice that TWO distinct DNS outcomes count as a void lookup! The obvious culprit is Status=3 (NXDOMAIN) from a typoed include: domain or a shuttered SaaS vendor whose domain expired. The hidden culprit is Status=0 (NOERROR / NODATA) with zero matching RRset answers! For instance, if marketing hosts example.com on a CDN or parks the apex without an A or AAAA record (redirecting only www.example.com), putting 'a' in example.com's SPF record queries example.com A -> returns 0 answers (NODATA) -> silently burns 1 of your 2 allowed void lookups on every single email!

Another frequent source of fake void-lookup alarms in naive web checkers is RFC 7208 §7 SPF macros (such as exists:%{i}._spf.mta.salesforce.com). A broken checker that queries the literal string '%{i}._spf...' over DNS gets NXDOMAIN and falsely reports a void lookup, whereas a real SMTP receiver expands %{i} to the connecting client IPv4 address before querying DNS. Always test macro-bearing records with a simulated sender IP in an RFC-aware SPF workbench.

Void Lookup Triggers & Diagnostic Matrix

Mechanism / CaseRFC 7208 EvaluationProduction Remediation
Churned vendor / Typoed include: (RCODE=3 NXDOMAIN)Increments both global mechanism count (+1) and void lookup count (+1).Audit all include: targets quarterly and immediately remove decommissioned SaaS tools.
a or a:host where host has TXT/MX only, no A/AAAA (RCODE=0, 0 answers)Counts as a NODATA void lookup (+1 void lookup) despite domain existing in DNS!Verify dig +short A <host> returns >=1 IP before keeping 'a' in v=spf1.
mx on subdomain with no MX records (or RFC 7505 Null MX '0 .')Zero usable MX answers increments void lookup counter.Never include 'mx' on outbound-only subdomains that do not publish inbound MX hosts.
exists:%{i}._spf.vendor.com tested without IP simulationUnexpanded literal %{i} returns NXDOMAIN in naive DNS tools; valid IPs resolve A=127.0.0.2 at SMTP time.Pass a real sending IP into OpsLint's simulatedIp field when auditing macro SPF records.

Edge Cases & Engineering FAQs

Does an include: that resolves TXT cleanly but does not match the sender IP count as a void lookup?

No! 'Void lookup' refers strictly to the DNS query returning zero DNS resource records (NXDOMAIN or NODATA), NOT whether the SPF CIDR matched the client IP. An include: that returns a valid TXT record costs 0 void lookups.

What if an include: domain exists (has an A record) but has NO TXT record at all?

Two bad things happen: first, the TXT query returns 0 TXT answers (NODATA -> +1 void lookup); second, per RFC 7208 §5.2 Table 1, an include: target that yields 'None' (no valid v=spf1 TXT record) immediately causes the parent SPF evaluation to abort with PermError!

How can I quickly scan our domain for void lookups from the terminal?

Paste your domain into the OpsLint SPF Workbench (which tracks Mechanisms, Per-MX, and Void Lookups separately), or inspect every a, mx, and include target with dig +noall +comments +answer TXT <target> looking for status: NXDOMAIN or ANSWER: 0.

Aligned Transactional Delivery Infrastructure

Transactional Email InfrastructurePostmark →

Dedicated transactional delivery streams with custom Return-Path subdomain SPF alignment and 2048-bit DKIM signing.