Email security
SPF "too many DNS lookups": what it means and how to fix it
SPF allows ten DNS lookups. A record that needs more returns an error instead of a pass, so the protection it was meant to give stops, often without anybody noticing until invoices start bouncing.
By Oscar CobbeCurrent as at 4 minute read3 sources
What the error means
SPF is the record in your domain's DNS that lists which servers may send email for you. A receiving server reads it each time a message arrives. Some parts of the record are written out in full, such as ip4: and ip6: addresses, and cost nothing to read. Others make the receiving server go and look something up: include:, a, mx, ptr and exists, and the redirect= modifier.
The SPF standard, RFC 7208, caps those lookups at ten for one check. Past ten, the receiving server stops and returns permerror, a permanent error. The same standard says a server should also give up after two lookups that find nothing at all ("void lookups"), which is what an include: pointing at a service you no longer use can produce.
Ten lookups, not ten includes
Microsoft's own example: an include: that points to a record with three more include: entries costs four lookups, one for itself and three for what it pulls in. A record with six includes can need fifteen lookups.
Why it appears suddenly
Every service that sends email as your domain, from your newsletter tool to your invoicing package, asks you to add its include:. Each one is reasonable on its own. The record fails on the day one more is added, and nothing in your own inbox tells you.
It can also break without anybody touching it. A provider can add an include: inside its own record, and your count goes up with it. Google's set-up page puts the rule as up to ten include: tags, which is the simple version of the same limit.
Microsoft adds a detail that makes the fault hard to spot. A receiving server reads the record left to right and stops at the first match, so mail from the service listed first can pass while mail from one near the end fails. The same record works for some messages and not others.
What it does to your email
Microsoft says the receiving system can refuse a message that fails this way, with a bounce that reads "The message required too many lookups" or "The message exceeded the hop count".
It also weakens DMARC, the policy that tells receivers to refuse email forged in your name. DMARC passes when either SPF or DKIM passes and lines up with your domain. With SPF in error, everything rests on DKIM: if a service sends unsigned mail, or signs it as itself, that mail now fails DMARC, and at p=reject it is refused. Our guide to SPF, DKIM and DMARC explains how the three fit together.
How to count yours
Counting by hand means following every include: to its own record and counting again, all the way down. The free email security check does that from public DNS and tells you the total, along with whether you have one SPF record or several, and what your DMARC policy says.
Two records is a fault of its own: the standard allows one per domain, and a receiver that finds two returns permerror whatever they contain.
Four ways to bring it back under ten
In the order to try them, cheapest first.
- 1Take out what no longer sends. An include: for a tool you stopped paying for still costs a lookup, and if its record has gone it costs a void lookup too.
- 2Move bulk and marketing email to a subdomain, such as news.yourdomain.ie, with its own SPF record. Microsoft recommends this for services you do not control, and each subdomain gets its own ten lookups.
- 3Replace an include: with the service's published IP ranges (ip4: and ip6:) where the service documents stable ones. Those cost no lookups, but you have to watch for the service changing them. This is what "SPF flattening" means.
- 4Send through fewer services. Two tools sending the same kind of email is two includes for one job.
Never flatten Microsoft 365's include
Microsoft's guidance is to keep include:spf.protection.outlook.com as it is: its sending addresses change, and a copy of today's list goes out of date without warning. The same goes for any service that does not publish fixed ranges.
Changing it without losing mail
Change one thing at a time and check the result before the next. Before you remove an include:, read your DMARC reports or ask the service whether it still sends for you: a service you forgot about is exactly the one a lookup was paying for.
Leave the end of the record as it is while you work. Microsoft recommends -all for Microsoft 365 domains, because it also recommends DKIM and DMARC alongside it. Google recommends ~all for Google Workspace. Either way, the setting that decides whether forged mail is refused is your DMARC policy, not this one.
If you would rather not do it yourself, our email protection job counts the record, fixes it, sets DKIM and moves DMARC to enforce, then scans again to show it from outside.
Sources
Free, and no account needed
Count your SPF lookups, free
Reads your domain's SPF record from public DNS, follows every include, and tells you how many of the ten lookups it uses, with your DKIM and DMARC alongside.
Run the free checkEmail protection, €450 once
Every service that sends as your domain found, SPF brought under the limit, DKIM signing on for each service, and DMARC moved to enforce once your own mail passes. A second scan shows it in place from outside.
See the pricesWho wrote this
Oscar Cobbe · Founder, FourWinds Digital
Writes and maintains the legal explainers on this site, and does the compliance work behind them. Every date and article number here is checked against the legislation itself before it is published, and each article shows the date it was last checked.
More about how we work →Read next
- Email securityCan someone send email as your business? What SPF, DKIM and DMARC decide
- Email securitySPF, DKIM and DMARC on Microsoft 365: the records and the order
- Email securityWhat does DMARC set-up cost?
Written on 29 October 2026; it describes the law as FourWinds read it on that date. This is general information about how the rules work, not legal advice on your situation. Where you need a solicitor, we say so. How we check the law.