SPF Too Many DNS Lookups? How to Fix the PermError Without Breaking Your Email
Your SPF record can look perfect and still fail every message. The 10-lookup limit is the usual reason. How to count your lookups, what to cut first, and how to get back under the limit safely.

Not sure if this is your problem?
Check your domain's email health in a few seconds before you read on.
Free, no signup. Reads public DNS records only, nothing is stored.
If a checker says your SPF has too many DNS lookups, or a bounce mentions "PermError" or "too many lookups," your SPF record has crossed a hard limit. The SPF standard, RFC 7208, says a receiver must stop after 10 DNS lookups and return a permanent error. When that happens, SPF doesn't pass for any message from your domain, no matter which server sent it.
The frustrating part is that nothing looks wrong. The record is one line, every service you added is on it, and it probably worked the day you saved it. Then you connected one more tool, or one of your providers changed its own record, and you went from 9 lookups to 11 without touching anything.
This guide covers what counts as a lookup, how to count yours, and how to get back under 10 without blocking your own email. If you want the bigger picture of how SPF fits with DKIM and DMARC first, start with our SPF vs DKIM vs DMARC guide.
What the 10-lookup limit is
Your SPF record is a list of who may send email for your domain. Some entries in that list are plain IP addresses. Others are names that the receiving server has to look up in DNS to find out which IP addresses they stand for.
RFC 7208, section 4.6.4, caps those lookups at 10 for a single check. The cap exists to stop one email from making a receiving server fire off dozens of DNS queries. Past 10, the standard says the result must be "permerror," which means the record can't be interpreted and someone has to fix it in DNS.
Two smaller limits sit beside the main one:
- Void lookups. RFC 7208 says receivers should allow no more than 2 lookups that come back empty or with "no such domain." An include pointing at a service you cancelled years ago can trip this one too.
- Record size. Google's documentation says an SPF record can have up to 255 characters and the TXT record should be no larger than 512 bytes. Long records full of IP ranges can hit this before they hit 10 lookups.
What counts as a lookup, and what doesn't
This is where most people miscount. They see six includes and assume they have six lookups.
| In your record | Costs a lookup? | Notes |
|---|---|---|
| include: | Yes, 1 | Plus every lookup inside the record it points to |
| a | Yes, 1 | Looks up your domain's (or the named host's) IP address |
| mx | Yes, 1 | Looks up your mail servers, then their addresses |
| exists: | Yes, 1 | Rare outside advanced setups |
| redirect= | Yes, 1 | Hands the whole check to another domain's record |
| ptr | Yes, 1 | The RFC says do not use it |
| ip4: and ip6: | No | Plain addresses cost nothing |
| all | No | The catch-all at the end |
The nested part matters most. Microsoft's SPF documentation gives the example plainly: an include that points to a record with three more includes adds four lookups in total, not one. Your CRM's include might pull in two of its own sending networks. Your newsletter tool might do the same. Those hidden lookups are what push a record over.

One more detail from Microsoft's documentation: receivers read the record left to right and stop as soon as the sending server matches. So a record that needs 12 lookups in total can still pass for mail from the first service on the list, and fail for mail from the last. That's why the problem often looks random: your Google Workspace mail is fine, and your invoices or newsletters land in spam.
How to count your SPF lookups
You have two options.
The quick way. Run your domain through our free email health check. It reads your SPF record, follows every include, including the ones nested inside, and tells you how many of the 10 lookups you use. It flags you at 8 or more, because one new tool would push you over.
By hand. Look up your domain's TXT records and find the one that starts with v=spf1. For each include, look up that domain's TXT record too, and count every include, a, mx, exists and redirect you find inside it. Keep going until you reach records that only list IP addresses. Add it all up, including the a and mx terms in your own record.
While you're there, check two things that cause the same symptom:
- Two SPF records. If your domain has two TXT records that start with
v=spf1, SPF fails with PermError before the lookup count even matters. Merge them into one. - Typos in includes. Microsoft lists the common ones: a trailing period after the domain, an equals sign instead of a colon, or a space after
include:. An include that doesn't resolve also returns PermError.
How to fix too many DNS lookups, in order
Work through these from the top. The early steps are safe and need no upkeep. The later ones work, but they need someone to keep an eye on them.
1. Remove senders you no longer use
Most records that go over the limit carry at least one include for a tool the company stopped using: an old email marketing platform, a trial CRM, a help desk from two years ago. Ask every team what actually sends email as your domain today, then delete includes for anything that doesn't.
If you're not sure whether something still sends, publish a DMARC record with a rua reporting address first. The daily reports list every server that sent mail as your domain, which settles the question with data instead of guesses.
2. Drop a and mx if those servers don't send
Many records carry a and mx out of habit, because a setup guide years ago included them. mx authorizes the servers that receive your mail. If you use Google Workspace or Microsoft 365, those servers are already covered by your provider's include, so mx adds a lookup and nothing else. The same goes for a if your website server never sends email. Remove them only after you've confirmed nothing sends from those servers.
3. Move bulk senders to a subdomain
This is the fix Microsoft recommends for third-party senders, and it solves two problems at once. Send newsletters from news.yourcompany.com and outreach from its own subdomain, each with its own SPF record. Each subdomain gets its own budget of 10 lookups, and a spam complaint problem in your newsletter no longer touches the domain your team uses for client email.
The sending tool has to support a custom subdomain, and you'll set up DKIM for it there too. Most do.

4. Replace an include with IP ranges, only as a last resort
This is what people call "SPF flattening": swap an include for the ip4: and ip6: ranges it currently resolves to. IP ranges cost no lookups, so the count drops.
The catch is upkeep. When the vendor adds or changes sending IPs, your record doesn't change with it, and mail from the new IPs fails SPF with no warning. Microsoft's guidance is to flatten only vendors with stable, documented IP ranges, never Microsoft 365 itself, to document what you replaced, and to review it at least every quarter. If nobody on your team will own that review, choose a subdomain instead.
What happens to your email while SPF is broken
PermError doesn't automatically mean every message bounces. What happens next depends on DKIM and DMARC:
- If every sender signs with DKIM on your own domain, DMARC can still pass, because it needs only one aligned pass (RFC 9989). Your mail keeps flowing while you fix SPF. This is why we treat aligned DKIM as the most important record of the three.
- If a sender relies on SPF alone, its mail now fails DMARC. With
p=none, it's judged on other signals and often lands in spam. Withp=quarantineorp=reject, it goes to spam or gets refused. At Gmail, that refusal often shows up as a 550 5.7.26 bounce. - Some receivers bounce the message outright. Microsoft's documentation says the bounce can read "The message required too many lookups."
So the short-term fix, if you need one today, is to make sure DKIM is on for every service. Then take the time to clean up SPF properly. If Outlook users in particular are telling you your mail went to junk, our guide to Outlook emails going to junk walks through how to tell an SPF problem from a reputation problem.
Keep it from happening again
The record broke because nobody owned it. A few habits stop a repeat:
- One owner for DNS. Whoever connects a new tool that sends email runs the free check before and after adding its include.
- Stay under 8. Leave room for the next tool. Our checker warns you at 8 for this reason.
- Re-check after vendor news. Providers change their own SPF records. Your count can change when theirs does.
- Watch DMARC reports. They show new senders before your customers notice a problem.
Check yours, or have us fix it
Run your domain through the free email health check to see your lookup count and every other SPF, DKIM and DMARC issue in plain English. If you'd rather hand it off, our Domain fix has a fixed price: $249, or $497 when SPF is broken (missing, duplicated or over 10 lookups) or you have up to 3 domains. We find every service that sends as you, fix SPF and DKIM for each one, and move DMARC toward enforcement as your reports allow. You keep every account and record.
Questions
- What does "SPF PermError too many DNS lookups" mean?
- Your SPF record needs more than 10 DNS lookups to evaluate. RFC 7208 tells receivers to stop at that point and return PermError, a permanent error, so SPF doesn't pass for any message from your domain until the record is fixed.
- Do ip4 and ip6 count toward the 10-lookup limit?
- No. ip4, ip6 and all cost no lookups. include, a, mx, exists, redirect and ptr each cost one, and includes nested inside an include count too.
- Will SPF PermError make my emails bounce?
- It depends on DKIM and DMARC. If every sender signs with DKIM on your domain, DMARC can still pass and mail flows. If a sender relies on SPF alone and your DMARC policy is quarantine or reject, its mail goes to spam or gets refused.
- Is SPF flattening safe?
- It works, but it needs upkeep. If the vendor changes its sending IPs, mail from the new IPs fails SPF with no warning. Microsoft advises flattening only vendors with stable, documented ranges, never Microsoft 365, and reviewing it at least quarterly.
- How do I count my SPF lookups?
- Run your domain through our free email health check, which follows every nested include and shows how many of the 10 you use. You can also count by hand by looking up each include's own record.
- Can I have two SPF records to split the lookups?
- No. Two SPF records on one domain is an error on its own, and SPF fails. To split senders, use subdomains, each with one SPF record of its own.
Sources
- IETF, RFC 7208: Sender Policy Framework (SPF), section 4.6.4, DNS Lookup Limits
- IETF, RFC 9989: Domain-Based Message Authentication, Reporting, and Conformance (DMARC), the current DMARC standard, which replaced RFC 7489 in May 2026
- Microsoft, Set up SPF to identify valid email sources for your Microsoft 365 domain
- Google, About SPF records
- Google, Email sender guidelines
Check your email health free
See your SPF, DKIM and DMARC in plain English, with the exact record to fix. If you'd rather we fix it, it's a fixed $249.
Free, no signup. Reads public DNS records only, nothing is stored.
Keep reading

