SPF PermError: too many DNS lookups
Last updated 2026-08-21
SPF has a hard budget of ten DNS-querying mechanisms, counted across every nested include. Cross it and the record does not degrade gracefully. It stops working entirely, and nothing in your DNS panel will tell you.
What it means. Evaluating your SPF record required more than ten DNS queries, so the
receiver abandoned it and returned permerror. Not a pass, not a fail, an
error.
What to change. Get the count to ten or below. Remove dead includes, replace your own servers
with ip4: literals, and move a heavy platform onto its own subdomain.
When it clears. Immediately on the next lookup after the TTL expires. There is no reputation damage to recover from, just a record to shrink.
Where you will see it
Or, in a bounce from a stricter receiver, alongside 550 5.7.23. Or nowhere at all, which is the dangerous case: mail keeps flowing, DMARC loses its SPF leg, and the first hard evidence is a 550 5.7.515 weeks later when someone tightens a policy.
What counts
| Mechanism | Costs a lookup | Note |
|---|---|---|
| include: | Yes, 1 each | Plus everything inside it |
| a | Yes, 1 | Also a/24 style forms |
| mx | Yes, 1 | Plus a query per MX host, capped at 10 |
| ptr | Yes, 1 | Deprecated by RFC 7208. Delete it. |
| exists: | Yes, 1 | Rare outside macro setups |
| redirect= | Yes, 1 | Plus the target record's own count |
| ip4: ip6: | No | Free. Use them. |
| all | No | Free |
There is a second budget people forget: at most two "void" lookups, meaning queries that return no records. An include pointing at a name that no longer exists burns one of those and eventually errors the record on its own.
See your real number
Counting by hand means resolving every include recursively, and the includes have includes. Run the domain through the SPF checker instead: it walks the whole chain, prints the resolution tree, and shows the total against the limit of ten. Providers restructure their own records without notice: Google's include nested three records for years and was flat when I checked on 2026-08-20, so the number moves under you.
To see it yourself for one include:
Getting under the limit
- Delete what you no longer use. Every SPF record over the limit that I have looked at had at least one include for a product the company stopped paying for. Start here; it is free.
-
Replace your own infrastructure with
ip4:. If you know the addresses and control them, literals cost nothing and never surprise you. This does not apply to a platform whose IPs change without telling you. -
Split by subdomain. The structural fix. Send marketing from
news.example.comand give that subdomain its own SPF record with its own budget of ten. Relaxed DMARC alignment means it still aligns with your From domain, as long as the From address is on the subdomain too. -
Drop
ptrand anyaormxyou do not need. Anmxmechanism authorises your inbound servers to send, which is usually not a thing they do. - Flatten last, and only the stable parts. Turning an include into IP literals works until the provider renumbers. If you flatten, write down what you flattened and check it on a schedule you will keep.
The thing to fix first
Get DKIM signing correctly for every sender before you spend a weekend on SPF arithmetic. DKIM has no lookup budget, it survives forwarding, and a domain with aligned DKIM everywhere passes DMARC even on a day when SPF is in permerror. SPF still needs fixing. It is just not the emergency it feels like. The long version of this argument, with the arithmetic, is in the guide.
You fixed this sender. Tomorrow the reports name the other hosts still sending as you, and we turn a day of XML into one email with a verdict per sender. On the paid plans, the day a report first names a new sender failing, you hear about it. Get the weekly digest. The first domain is free.
Hear about the next failing sender first
This rejection named one sender, and the next to break sends no warning ahead of it. On a paid plan, the first failing report from a new source reaches you as an email that day, not in Monday's digest. Pro watches 5 domains for $19 a month.
Get the alerts and the digestNo card · 12+ months of history · The free plan does not expire
Questions
Does a permerror mean my mail bounces?
Not by itself. SPF returns permerror instead of pass, and what happens next depends on the receiver. The reliable consequence is that DMARC can no longer pass on SPF, so every message with unaligned or missing DKIM starts failing DMARC.
Do ip4 and ip6 mechanisms count toward the ten?
No. Only mechanisms that require a DNS query count: include, a, mx, ptr, exists and the redirect modifier. ip4, ip6 and all are free, which is why replacing your own servers with ip4 literals is the cheapest win available.
Is flattening the SPF record a good idea?
It works and it is a maintenance burden. The provider changes its IPs and your frozen copy is wrong, usually on a Friday. Flatten only what is stable, keep the includes for anything that is not, and monitor the result.
Keep reading
Checking as you fix? Our DMARC checker, SPF checker and DKIM checker read the records live, no signup.