Skip to content
spfemail-authenticationemail-deliverabilityecommercedmarc

SPF 10-Lookup Limit and SPF Flattening

SPF fails with a permerror after too many DNS lookups. Flattening can pass the check today and break when your ESP changes IP ranges.

Udhayakumar M

3 min read

SPF 10-Lookup Limit and SPF Flattening
On this page

The SPF record looked fine for a year. Then you added a review platform, a second ESP for receipts, and the helpdesk. The next authentication test says permerror. Nothing was “hacked.” The record asked DNS more questions than SPF allows.

Last verified: 26 September 2026, against RFC 7208 section 4.6.4.

What the SPF 10-lookup limit counts

RFC 7208 limits SPF evaluation to 10 DNS lookups from mechanisms and modifiers that query DNS. include, a, mx, ptr, exists, and redirect do that. ip4 and ip6 do not. Lookups inside an include count as well. Ten vendors is not the limit. Ten lookups is the limit, and one vendor’s include can contain several. A record with only four include: lines can still exceed 10 lookups once the nested includes are counted. Whether yours does depends on how each vendor builds its record today, and vendors change that without telling you, so count the live record with the SPF record checker rather than the text you pasted.

A result over the limit is a permerror. It is not a soft fail you can shrug off, and it is not a pass. The short operational page is SPF hard fail. This page is the decision that page does not have room for: whether to flatten.

DMARC still has a second path. If DKIM is aligned and passes, DMARC can pass while SPF permerrors. That is why a campaign can “look authenticated” in one tool and fail SPF in another. Aligned DKIM is not a reason to leave the SPF record broken. The next receiver, or the next incident, will be the one that needed SPF. SPF, DKIM, and DMARC is the overview. Alignment is why a pass on the wrong domain still fails DMARC.

Multiple ESPs are how stores hit the limit

Marketing in Klaviyo, receipts in SES or another transactional tool, a support desk, a review app, and a leftover include from the ESP you migrated off last year. Each include is a lookup, and some of those includes exist so the vendor can change IPs without asking you to edit DNS.

That design is good until the sum crosses 10. The migration guide tells you to add the new sender before you cut over. It should also end with deleting the old include after the cutover is done. An include you no longer send through still costs a lookup on every message. SPF is not the only record a second sender touches: multiple DKIM selectors is the DKIM side of the same change.

When flattening helps, and when it creates the next outage

Flattening copies today’s IPs into your record so you stop paying the lookup. Use it when:

  • You have already removed dead vendors and you are still over 10.
  • You know which company owns each IP block you pasted in.
  • You have a way to notice when that company publishes a new range.

Do not flatten as a permanent architecture. ESPs rotate addresses. A flattened record that was correct in March will start failing SPF, or fail to authorize the new path, when the include would have followed the change and your copy did not. The failure mode is quiet: mail keeps going out, SPF starts failing, and DMARC depends entirely on DKIM until someone looks.

Prefer this order:

  1. Delete unused mechanisms.
  2. Ask whether two tools can send under one include you already have.
  3. Flatten the minimum set that remains, and date the change.
  4. Rebuild on a schedule, or when a vendor’s IP notice arrives.

The SPF generator is useful for assembling the record. It does not know which includes are abandoned. You do.

InboxEagle

Count your SPF lookups after every include you add or remove

The free SPF checker resolves your live record, nested includes and all, and shows whether it stays under 10 lookups. Run it again whenever a vendor joins or leaves.

Sources

  • SPF, section 4.6.4, RFC 7208. The 10-lookup limit and permerror.
  • DMARC, RFC 9989. DMARC can pass on aligned DKIM when SPF does not pass. The policy RFC does not raise the SPF lookup limit.

Frequently Asked Questions

What is the SPF 10-lookup limit?
RFC 7208 says SPF evaluation must not require more than 10 mechanisms or modifiers that trigger DNS lookups. include, a, mx, ptr, exists, and redirect count. ip4 and ip6 do not. Going over the limit returns a permerror. A permerror is not a pass, so DMARC cannot use SPF for that message.
What is SPF flattening?
Flattening replaces include mechanisms with the IP addresses those includes resolved to on the day you flattened. The new record uses ip4 or ip6, which do not count as lookups, so the permerror goes away. The record is now a copy. When the ESP adds or retires IPs, your copy is wrong until you flatten again.
Should I flatten SPF or remove includes?
Remove includes you no longer send through before you flatten. Each ESP, support tool, and old vendor adds an include. A record that is over the limit because of abandoned vendors should be shortened, not frozen into IPs. Flatten only the includes you must keep and cannot reduce another way, and put a reminder on the calendar to rebuild the record when those vendors change ranges.
If SPF permerrors, does all mail fail?
DMARC passes if either aligned SPF or aligned DKIM passes. A permerror means SPF did not pass. Aligned DKIM can still satisfy DMARC. Receivers that require SPF for their own reasons, and any tool that only checks SPF, will still show a failure. Do not treat DKIM as a reason to ignore a broken SPF record.
Udhayakumar M
Udhayakumar M·Content Marketer

With 8+ years writing for 80+ SaaS products, Udhay knows how to make complex ideas land. At InboxEagle, he turns email deliverability data into plain-English strategy — helping eCommerce brands understand why emails end up where they do, and what to do about it.

LinkedIn
Share this article:Share on XShare on LinkedIn
Explore with AI

Open this content in your AI assistant for deeper analysis, or copy it as Markdown to paste anywhere.

ChatGPTClaudePerplexity

Related Articles

One deliverability insight, every Friday.

Trusted by 2,000+ email senders. Free, always.

Free Checklist

The exact checklist used by 2,000+ email senders to diagnose and fix inbox placement issues — free.

  • Authentication setup (SPF, DKIM, DMARC)
  • Sender reputation signals to monitor
  • List hygiene benchmarks
  • Content & engagement red flags

No spam. Unsubscribe any time.