Guides · Updated October 28, 2026 · Not legal advice; provider rules change, so check the linked sources.
How to fix "SPF too many DNS lookups" (PermError)
SPF has a hard limit: evaluating your record may trigger no more than 10 DNS lookups (RFC 7208, section 4.6.4). Go over it and receivers return permerror, which most treat as an SPF failure. If DKIM isn't aligned either, DMARC fails too and your mail can land in spam or be rejected.
What counts toward the 10
- Counts:
include,a,mx,ptr,existsandredirect. Each is a lookup, and so is every one of those inside the records you include. - Doesn't count:
ip4,ip6andall. - Also limited: no more than 2 "void" lookups (names that return nothing) are allowed, so stale includes for services you dropped can break SPF on their own.
Count your lookups
dig +short TXT yourdomain.com
dig +short TXT _spf.google.com
Start with your v=spf1 record, then look up each include: and add up the mechanisms above, nested ones included. Large providers often use several lookups each, so four or five services can push you past 10. The free scan shows your SPF record and flags common errors.
Ways to get under the limit
- Remove senders you no longer use. Old newsletter tools, CRMs and former hosts are the most common cause.
- Drop
ptr. RFC 7208 says not to use it. - Replace
aandmxwithip4/ip6when your own server's addresses are fixed and known, and only if that server actually sends mail. - Move bulk or marketing senders to a subdomain such as
news.yourdomain.com. Each subdomain has its own SPF record and its own 10-lookup budget, and DMARC's relaxed alignment still passes when the visible From uses that subdomain. - Lean on DKIM for services that support it. DMARC passes if either SPF or DKIM passes and aligns. Many services send with their own bounce domain, so their include in your SPF may not help DMARC at all. Check each provider's docs before removing one.
- Flatten only with care. Replacing includes with the IP ranges they resolve to cuts lookups, but providers change their ranges without notice. A hand-flattened record goes stale and starts failing silently, so it needs regular re-checking.
After you change it
- Keep exactly one SPF record on the domain. Two records is also a permerror.
- Send a test message to Gmail and check "Show original": SPF should say PASS. See how to check SPF, DKIM and DMARC.
- Watch your DMARC reports for a few days for senders you missed. See DMARC basics.
Not sure what's sending as you? Run the free ExclusiveTrust scan. If you'd rather not touch DNS yourself, our managed fix sorts out SPF, DKIM and DMARC for you, and Trust Monitor re-checks your records daily so a provider change doesn't quietly break them.