Why Does Your SPF Record Fail With Too Many DNS Lookups?
Published 2026-11-14 · Reviewed 2026-11-14 · 6 min read · By the Ingenious AI team
Is someone impersonating your domain right now?
Run the free DomainGuard scan: lookalike registrations, MX-armed variants, certificate-transparency and CAA checks for your domain, in one report.
Run my free DomainGuard scanThe short answer
Your SPF record fails because SPF evaluation is capped at 10 DNS-querying mechanisms, and every include, a, mx, ptr, exists, or redirect counts against that cap — including the lookups hidden inside each vendor's own include. When the count passes 10, receivers return a permanent error (permerror) and treat your mail as if it had no SPF at all. The fix is an audit: expand every include tree, count honestly, remove dead vendors, replace mx and a mechanisms with explicit ip4 ranges where stable, and never flatten blindly without understanding the trade-offs.
The 10-lookup budget, explained plainly
SPF was designed when DNS was slower, so the specification limits how much work a receiver may do checking one message: ten mechanisms that cause DNS queries. Simple mechanisms like ip4 and ip6 are free. Everything that asks a question — include, a, mx, ptr, exists, redirect — costs one, and an include costs one plus everything inside the included record that also asks questions. A single popular sending platform can consume three or four lookups through nested includes you never see in your own DNS zone.
This is why SPF breaks silently when marketing adds a tool. Your record looked fine at eight lookups. The new vendor's include pushed the real, expanded count to eleven. Nothing in your DNS console warned you, because your console only shows your one line of text. The failure only exists at evaluation time, on the receiver's side, message by message.
How to count your real lookup total
Start by fetching your record and expanding it recursively. Several free SPF survey tools will walk the include tree and show the running total with each branch labelled. Do it manually once, though, so you understand your own record: write down each mechanism in order, and for every include, fetch that record too and count its DNS mechanisms the same way. Pay attention to the mx mechanism in vendor records — it costs one lookup plus one A-record lookup per MX host returned.
Also count void lookups: queries that return nothing. SPF allows at most two before that, too, becomes a permerror. Dead includes pointing at decommissioned vendor domains are the usual cause. A record can therefore fail two different ways — too many lookups, or too many empty answers — and bloated legacy records often flirt with both limits at once.
The usual suspects that burn the budget
Office-suite includes are the baseline cost most domains carry, and CRM, help-desk, marketing-automation, and e-commerce platforms each add their own. The waste is rarely the platforms you use daily; it is the ones you stopped using. Pilot tools from two years ago, the webinar platform from one campaign, and the legacy sending service kept 'just in case' all still sit in the record consuming lookups and — worse — still authorising those vendors to send as you.
Treat SPF pruning as access revocation, not tidiness. Every mechanism in the record is a standing permission for some infrastructure to send mail as your domain. Removing a departed vendor both recovers lookups and closes a real spoofing path, because a compromised or careless ex-vendor account should never retain the ability to pass your SPF.
Fixes that work without flattening
First, delete dead includes. Second, replace expensive mechanisms with cheap ones where the vendor publishes stable sending ranges: an mx mechanism can often become two or three ip4 entries, and an a mechanism for a single host can become its literal address. Third, split sending across subdomains. Transactional mail from a dedicated subdomain carries its own SPF record and its own lookup budget, so your marketing stack's growth stops threatening your invoicing mail.
SPF flattening — resolving all includes into a flat list of IP addresses — works mechanically but creates a maintenance debt: vendor ranges change, and a stale flattened record fails good mail or authorises departed infrastructure. If you flatten, use a service that re-resolves and republishes automatically, and alert on changes. Hand-flattened records copied into DNS and forgotten are a future outage with a date you do not know.
Validate like a receiver, then monitor
After editing, validate the record three ways: a syntax checker for structure, an expansion tool for the true lookup and void counts, and a real test message to a major mailbox provider, checking the Authentication-Results header for spf=pass rather than permerror. Then send through every platform in the record, not just your mailbox — each vendor's path through the record is different, and the branch you pruned may be the branch one of them needed.
Finally, schedule a quarterly SPF review alongside your DMARC report reading. Lookup creep is gradual and always caused by someone adding a tool with good intentions. A standing review turns a silent permerror into a five-minute cleanup, and your DMARC alignment data will warn you early: a rising share of SPF permerrors in aggregate reports is the smoke before this particular fire.
Five actions to take today
- Expand your full SPF include tree and write down the true DNS lookup count and void lookup count.
- Remove every vendor you no longer use — each deletion recovers lookups and revokes standing sending permission.
- Replace mx and a mechanisms with explicit ip4 or ip6 entries wherever the sending addresses are stable.
- Move bulk or transactional sending to dedicated subdomains so each stream gets its own 10-lookup budget.
- Send a test message through every authorised platform and confirm spf=pass, not permerror, in the Authentication-Results headers.
Worked example: Trailhead Outfitters cuts 14 lookups to 7
Trailhead Outfitters, a fictional e-commerce retailer monitoring 4 domains, found its SPF returning permerror after a busy year of tool adoption. Expanding the record showed 14 lookups: its mailbox suite used 3, its store platform 3, a retired webinar tool 2, a legacy help desk 2, and smaller tools the rest. Deleting the two departed vendors recovered 4 lookups instantly. Replacing one mx mechanism with two stable ip4 ranges saved 2 more, landing at 7. DMARC reports over the next month showed SPF permerrors falling from 18 percent of its mail to zero, and aligned SPF passes rising to 96 percent.
FAQ
What happens to my mail when SPF returns permerror?
Receivers treat the message as having no SPF result at all. If the message also fails DKIM alignment, DMARC fails too. Mail is not always rejected on the spot, but it loses authentication protection and is scored as riskier.
Do ip4 and ip6 mechanisms count toward the 10 lookups?
No. Literal address mechanisms are evaluated without DNS queries, which is why replacing stable mx or a mechanisms with explicit addresses is an effective fix.
Is SPF flattening a good idea?
It works, but only safely with automation that re-resolves vendor ranges and updates DNS when they change. A manually flattened record goes stale silently and eventually fails legitimate mail or authorises old infrastructure.
How do I know which vendor an include belongs to?
Follow the include domain: most vendors use recognisable hostnames, and your DMARC aggregate reports show which sending services actually send as you. An include with no matching traffic in 90 days of reports is a removal candidate.
Can I just use multiple SPF records instead?
No. A domain may publish exactly one SPF record; publishing two causes a permerror of its own. Combine everything into a single TXT record, or split sending across subdomains, each with its own single record.