How does the SPF 10-lookup limit work technically?
Still have a question, spotted an error, or have a better explanation or a source we should cite?
Your SPF record looks fine at a glance. But once a receiving mail server starts chasing all those include: statements and nested references, you might be way closer to the 10-lookup limit than you think.
Here's how it works. When a mail server receives your email, it reads your SPF record and has to resolve certain mechanisms by making DNS queries. The spec only allows 10 of those queries before it stops, marks the result as permerror, and treats authentication as failed. Not deferred. Failed.
What counts toward the 10
include:counts as one lookup, plus every lookup inside the included recorda:counts as one lookupmx:counts as one lookup per MX record, then another for each A record resolutionredirect=counts as one lookupexists:counts as one lookup
What does NOT count
ip4:andip6:are literal values, no DNS query neededallis a catch-all, no lookup required
The tricky part is recursion. When you use include:mailchimp.com, that pulls in Mailchimp's SPF record. If their record has three include: statements of its own, those all count toward YOUR limit too. You don't control what's inside a vendor's SPF record, and vendors update theirs without telling you.
Here's a real example of how it adds up fast. Say your record has three include: statements (for your ESP, your CRM, and your support tool). Each of those vendors has three include: statements in their own record. That's 3 direct lookups plus 9 nested ones. Twelve total. Two over the limit. permerror.
Still the fix isn't always obvious. Some senders move to SPF flattening, which replaces those nested include: chains with literal IP addresses so no DNS queries are needed. It works, but it comes with its own trade-offs worth reading about before you go that route.
Want to see exactly where your record stands right now? You can check your SPF record with our free tool and it'll show you the full lookup count. If you're already over 10 (or uncomfortably close), it's worth a conversation before your next campaign goes out.
Contributors
Who worked on this answer
Every name links to their profile. Every company links to their site. Real people, real accountability.