The SPF 10-lookup limit, explained
An SPF record may trigger at most 10 DNS lookups. Go one over and SPF fails for every message you send, with no warning. Each new email tool adds a few lookups, so it is easy to cross without noticing.
What counts as a lookup
Every mechanism that makes the receiver query DNS counts, including the ones nested inside the records you include:
- Count:
include:,a,mx,exists:,redirect=, andptr(which you shouldn't use at all). - Free:
ip4:,ip6:andall.
Nesting is the trap. include:_spf.google.com looks like one lookup but costs four, because Google's record includes three more. A record with five innocent-looking includes can easily need twelve.
v=spf1 include:_spf.google.com include:sendgrid.net include:mail.zendesk.com include:servers.mcsv.net include:_spf.salesforce.com ~all
There is also a second, lesser-known limit: no more than two lookups that return nothing (“void lookups”), for example an include that points at a domain with no SPF record.
What happens when you go over
The receiver stops and returns a permanent error (permerror). SPF is treated as failed for all mail, legitimate or not. If DKIM is set up and aligned, DMARC can still pass on DKIM alone. If it isn't, your mail starts landing in spam or is rejected, depending on your DMARC policy.
How to get back under 10
- Remove tools you no longer use. Old includes for a past newsletter tool or CRM are the most common cause.
- Drop includes for tools that use their own bounce domain. Many senders (most marketing and support tools) don't need to be in your SPF at all once DKIM with your domain is set up. Check each tool's documentation.
- Move bulk mail to a subdomain. Send newsletters from
news.example.comwith its own SPF record. It gets its own 10 lookups, and DMARC still aligns with your main domain. - Replace
aandmxwith IP ranges when they point at servers you control and that rarely change.
Be careful with “SPF flattening” services that replace includes with long lists of IP addresses. Providers change their IPs, and a stale flattened record breaks just as silently.
See how many lookups your record uses, including every nested include.