SPF PermError: “too many DNS lookups” — how to fix it
SPF allows only 10 DNS lookups. Above that, SPF fails with a PermError. Here's how to count them and get back under the limit.
Updated
SPF (Sender Policy Framework) has a hard limit: evaluating your record may cause at most 10 DNS lookups (RFC 7208). If your record needs more, receiving servers stop and return PermError — and SPF counts as failed for every email you send. Often this happens silently the day you add one more email service.
What counts as a lookup
- Each
include:,a,mx,ptr,exists:andredirect=costs one lookup. - Lookups are counted recursively: if
include:_spf.example.netitself contains three includes, that's four lookups in total. ip4:,ip6:andalldon't cost lookups.- Separately, at most 2 “void” lookups (includes that return nothing) are allowed — dead includes from cancelled services can break SPF too.
How to get under 10 lookups
- Remove services you no longer use. Old newsletter tools, CRMs or helpdesks are the most common reason.
- Check whether a service needs your SPF at all. SPF checks the envelope sender (Return-Path), not the visible From address. Many email platforms send with their own bounce domain, so including them in your SPF does nothing — DMARC passes through DKIM instead. Check each provider's docs before adding its include.
- Replace `a` and `mx` with `ip4:` when you know your server's IP addresses and they rarely change.
- Move bulk email to a subdomain, e.g.
news.example.comwith its own SPF record. Your main domain's record stays small. - Avoid “SPF flattening” scripts unless you monitor them: they replace includes with IP lists that break when the provider changes IPs.
Example
Before — 12 lookups, PermError:
v=spf1 include:_spf.google.com include:spf.protection.outlook.com include:sendgrid.net include:servers.mcsv.net include:mail.zendesk.com include:_spf.salesforce.com mx a ~allAfter — Outlook no longer used, Mailchimp sends with its own bounce domain, mx/a replaced with the server IP:
v=spf1 ip4:203.0.113.10 include:_spf.google.com include:sendgrid.net include:mail.zendesk.com include:_spf.salesforce.com ~allAlways re-check after a change — and remember there must be only one SPF record per domain. Two records cause a PermError as well.
Check your page in seconds
Free, no signup: see what's wrong and get the exact DNS records to fix it.
Check your domain with the free SPF, DKIM & DMARC checker →