Fix SPF PermError: Too Many DNS Lookups (10-Lookup Limit)
Why SPF breaks with PermError past 10 nested DNS lookups under RFC 7208, how to count hidden nested includes, and the cleanest ways to fix it.
SPF PermError: Too many DNS lookups (exceeded maximum of 10 DNS-querying mechanisms)Count your recursive SPF DNS lookups live
Recursively expands every nested include: in your SPF record and tells you which providers consume the most lookups.
Why SPF suddenly breaks with PermError
Under RFC 7208 Section 4.6.4, a receiving mail server must abort SPF evaluation with PermError as soon as resolving your record requires more than 10 DNS lookups.
The catch that blindsides almost every growing SaaS or ecommerce team is that nested includes count:
include:_spf.google.comalone expands into 3 to 4 nested lookups.- Adding Microsoft 365, HubSpot, Zendesk, Mailchimp, SendGrid, and Stripe/billing on the same root domain easily crosses 12 to 16 nested lookups, even though your TXT record looks short.
- Once you hit lookup #11, every sender on that domain (including your corporate Google Workspace or Microsoft 365 inbox) fails SPF with
PermError, triggering Gmail 550 5.7.26 and Outlook 550 5.7.515.
A second cause of SPF PermError is publishing two separate v=spf1 TXT records on the same domain instead of combining them into one.
Count your real nested lookups right now
Check your root TXT records:
dig TXT yourdomain.com +short | grep spf1Make sure only one line returns. Then recursively check the full lookup tree with our domain email deliverability audit (or our dedicated SPF checker).
Mechanisms that consume lookups: include, a, mx, ptr, exists, redirect.
Mechanisms that do not consume lookups: ip4, ip6, all.
Step-by-step fix (from safest to last resort)
1. Remove dead and redundant mechanisms
Audit every include: in your TXT record and delete any vendor you stopped using last year. Also check for these common wastes:
- Remove
ptr(deprecated by RFC 7208 and costs a lookup). - Remove
aandmxunless your web server or inbound MX servers literally send outbound email directly. - Remove any ESP
include:if that ESP uses its own custom bounce subdomain (Return-Path: bounce@mail.yourdomain.com) and never uses your root domain as the envelope sender.
2. Delegate email streams to subdomains (the permanent fix)
The cleanest architectural fix is subdomain isolation. SPF is evaluated against the Return-Path (envelope sender) domain, and relaxed DMARC (aspf=r, the default) still aligns subdomains like mail.yourdomain.com with From: hello@yourdomain.com.
Give each major stream its own clean SPF record:
| Stream | Envelope / Return-Path domain | SPF lookups used |
|---|---|---|
| Corporate email | yourdomain.com (Google Workspace / M365 only) | 3 to 4 |
| App & lifecycle email | mail.yourdomain.com | 1 to 2 |
| Marketing campaigns | news.yourdomain.com | 1 to 2 |
| Support helpdesk | support.yourdomain.com | 1 to 2 |
Your root domain drops back to 3 to 4 lookups permanently, and adding a new marketing tool can never break company email again.
3. Consolidate overlapping email tools
Every separate tool you use for transactional receipts, newsletters, dunning, and onboarding adds 1 to 3 SPF lookups and another DKIM setup to maintain. Consolidating transactional and lifecycle email onto one ESP immediately cuts 2 to 4 lookups off your DNS tree.
4. Use SPF flattening only as a stopgap
If you have legacy systems that cannot move to a subdomain yet, you can inspect flattened IP ranges with our SPF flattener tool, but keep in mind that cloud email providers rotate IPs regularly. Never leave a manually flattened record unmonitored.
Or keep your SPF footprint small with Sequenzy
Sequenzy sends both transactional emails and lifecycle/marketing campaigns from a single verified platform using a dedicated custom return-path subdomain, so it does not bloat your root domain's 10-lookup SPF budget.
Official sources
- RFC 7208 Section 4.6.4: DNS Lookup Limits (SPF)Checked 2026-12-04
- Google Workspace: Troubleshoot SPF issuesChecked 2026-12-04
- Microsoft Learn: How Microsoft 365 uses SPF to prevent spoofingChecked 2026-12-04