How do I fix "SPF record too many DNS lookups"?
By Ash, Founder, HosteazePublished 2 min read
The short answer
SPF allows a maximum of 10 DNS lookups. Every include, a, mx, ptr, exists and redirect term counts, including the ones hidden inside each include. Go over and SPF returns a permanent error, so it fails for all your email. Fix it by removing services you no longer use and dropping unnecessary a and mx terms.

Your SPF record has a budget, and it's small. The SPF standard caps the number of DNS lookups a receiving server will make while checking it at 10. It's there to stop SPF checks being used to flood DNS servers, and it's easy to blow through once a business has added a few email tools over the years.
Why does SPF have a 10-lookup limit?
Each time a receiving server checks your SPF, it may need to look up more records to find the full list of allowed servers. The standard says that after 10, it must stop and return a permerror. A permanent error means SPF fails for every email you send, not just the ones from the eleventh service.
These terms each cost one lookup:
include:aandmxptr(deprecated, so remove it anyway)exists:redirect=
ip4:, ip6: and all cost nothing.
Why does my record go over when it only has four includes?
Because includes can contain includes. Each include: costs one lookup, and if the record it points to has its own includes, those count towards your 10 as well. When we checked in October 2026, Google's _spf.google.com and Microsoft's spf.protection.outlook.com listed IP addresses directly, so they cost one lookup each. Some marketing, helpdesk and CRM tools nest two or three levels deep, so four includes can quietly cost eight or more.
How do I count my SPF lookups?
- Look up your domain's TXT record in the free Google Admin Toolbox Dig tool and find the one starting
v=spf1. - Count each
include:,a,mx,ptr,existsandredirectin it. - For each include, look up that domain's TXT record too and count its terms in the same way.
- Add them up. A free SPF checker will do this for you and show the total.
How do I get back under 10?
Work through these in order, checking the count after each:
- Remove services you no longer use. The old newsletter tool from 2019 is a classic.
- Remove
aandmxterms unless your own web or mail server actually sends email. Many records have them by default for no reason. - Remove
ptrentirely. - Check if a service now prefers DKIM. Many newsletter and CRM tools authenticate with DKIM instead, and their help pages say the SPF include is optional.
- Move bulk email to a subdomain, such as
news.yourdomain.co.uk, with its own SPF record. - Flatten only what's left, using a service that keeps the IP addresses up to date.
Once you're under the limit, send a test email to a Gmail account and check it shows SPF: PASS under Show original. If your emails were going to spam, this alone can fix it. For setting up the rest, see how to set up SPF, DKIM and DMARC.
Frequently asked questions
Do ip4 and ip6 terms count towards the limit?
No. ip4, ip6 and all don't need a DNS lookup, so you can list as many IP addresses as you like without using up the 10.
Is SPF flattening a good idea?
Only as a last resort. Flattening replaces includes with the IP addresses behind them, but providers change those addresses without warning. Use a service that re-flattens automatically, or fix the root cause instead.
Can I split my SPF record into two?
Not on the same domain. Two SPF records break SPF. You can send some email, such as newsletters, from a subdomain like news.yourdomain.co.uk, which gets its own SPF record and its own 10 lookups.




