Guide
SPF has too many DNS lookups
If your SPF record needs more than 10 DNS lookups, receivers stop checking it and report a permanent error. Your genuine email can then fail SPF, and so fail DMARC. It's one of the most common SPF faults.
What counts as a lookup
SPF limits the number of DNS lookups needed to evaluate a record to 10. These mechanisms each cost one lookup: include, a, mx, ptr, exists and redirect. Lookups inside an included record count too, which is how a handful of services add up quickly. ip4, ip6 and all are free.
How you end up over the limit
Each service that sends as you asks you to add its own include:. Microsoft 365, a marketing platform, a CRM, a helpdesk and a payroll provider can easily use more than 10 between them, because each of their includes may contain several more.
Ways to fix it
- Remove senders you no longer use. Old includes for retired services are the easiest saving.
- Replace a service with DKIM. If a sender signs mail with your domain's DKIM, DMARC passes without it being in SPF at all. Check whether it can.
- Move bulk senders to a subdomain. Send marketing from
news.example.co.ukwith its own SPF record. - Flatten the record. Replace the includes with the IP addresses they resolve to. This works, but the addresses change when providers change them, so a hand-flattened record goes stale and silently breaks.
Flattening that stays up to date
Mailfletch's hosted SPF does the flattening for you. You publish a single record that points at Mailfletch, manage your senders from the dashboard, and the flattened record is regenerated automatically so it stays under the limit and keeps up with provider changes.
Check your record
The free domain check counts your SPF lookups and tells you if you're over.
Common questions
What happens if SPF has more than 10 lookups?
The receiving server returns a permanent error (permerror). Many treat that as an SPF failure, so mail that depends on SPF can be rejected or sent to spam.
Is it safe to flatten SPF by hand?
It can work, but the IP addresses behind each include change over time. Unless something refreshes the record, it will eventually miss a sending address.