Email authentication error
SPF too many DNS lookups: why it breaks and how to fix it
An SPF record may trigger at most 10 DNS lookups while a receiving server evaluates it. Go past 10 and the check stops with a permanent error, called a permerror, which receivers treat as a failure. The result is that real mail from your own domain can land in spam or be rejected, and your DMARC policy may act on it, even though every sender in the record is legitimate.
By Kyle Deligny, Titanos, Brisbane. Last reviewed 1 December 2026. General information, not legal advice.
The limit is written into RFC 7208, the SPF standard. This page explains what is counted, how to count your own record, and four fixes ranked from safest to riskiest. If you only want a clean record, our SPF builder checks the count as you type.
What counts toward the limit
Section 4.6.4 of RFC 7208 counts every mechanism or modifier that needs a DNS query: include, a, mx, ptr, exists and the redirect modifier. Each include also triggers the lookups inside the record it points at, so one line in your record can cost several lookups once the other company's own includes are followed.
Mechanisms that need no query are free: ip4, ip6 and all. Writing an address range directly costs nothing, which is the basis of the main fix. The standard also limits void lookups, queries that return nothing, to two, so a record full of old includes for services that no longer publish records can fail for that reason.
A related error is publishing two SPF records on one domain. Section 4.5 says a domain must have only one, and two records also produce a permerror. Merge them into one record rather than adding a second.
Why small businesses hit it
Every service you add asks you to add its include: the main mailbox provider, the invoicing tool, the booking system, the newsletter platform, the helpdesk and the CRM. Many of those providers chain several includes of their own. After a few years of additions, with nobody removing services that were cancelled, the count creeps past 10 and nothing warns you.
The failure is also quiet. SPF errors do not bounce your mail in an obvious way, and a message may still pass through DKIM alignment and arrive, so the first sign is often a client saying they never got the invoice.
How to count your lookups
Look up your TXT record that starts with v=spf1, then follow each include by hand, counting one lookup for each include, a, mx, exists and redirect, plus each nested one. A free checker does the same walk automatically, and it is worth running after any change. Stop the count at 10 and note which includes are deepest, because those are the best candidates to remove or replace.
Four fixes, safest first
First, delete includes for services you no longer use. This is free and risk-free once you have confirmed that nothing still sends through them. Check the sender names in your DMARC reports before you delete.
Second, replace mx and a mechanisms with direct ip4 or ip6 ranges where the addresses are stable. Third, send the heavy senders from a subdomain: a newsletter platform can use news.yourbusiness.com.au with its own SPF record, which gets its own 10 lookups and takes load off the root domain.
Fourth, and only if the others fail, use flattening, which replaces includes with the addresses they resolve to. The risk is that providers change their ranges without telling you, so a flattened record goes stale and starts failing again. If you flatten, use a managed service that refreshes the record, and set a diary reminder to check it monthly.
What the fix does not touch
Passing SPF is one of two routes to a DMARC pass. DKIM signing is the other, and it has no equivalent 10 lookup limit. Making sure each sender signs with DKIM for your domain protects you when SPF breaks, so a record that is back under the limit is a repair, not a finish line. Our guide to moving from DMARC p=none to enforcement covers the next step once the reports are clean.
Bring your SPF record under 10 lookups
- Copy your current v=spf1 TXT record into a text file as a backup.
- Confirm you have exactly one SPF record on the domain and merge any second one.
- Count lookups by following every include, a, mx, exists and redirect.
- List which real services send mail as your domain, using DMARC reports and your own knowledge.
- Delete includes for cancelled services and test that nothing breaks.
- Swap mx and a mechanisms for fixed ip4 or ip6 ranges where the addresses are stable.
- Move bulk senders such as newsletters to a subdomain with its own record.
- Publish the edited record and re-run a lookup checker to confirm 10 or fewer.
- Send a test message to a Gmail address and read the Authentication-Results header for spf=pass.
- Re-check the record after any new service is added.
Questions people ask
Does the 10 lookup limit count the number of includes or the number of queries?
It counts DNS queries. Each include is one, and every include, a, mx, exists or redirect inside the included record adds more, so one include from a large provider can use several of your 10.
Will exceeding the limit make my emails bounce?
It produces a permerror, which receivers treat as an SPF failure. What happens next depends on the receiver and on your DMARC policy. With a policy of none the mail is usually delivered but may score worse for spam; with quarantine or reject it can be filtered or refused.
Is SPF flattening safe?
It works, but a flattened record can go out of date when a provider changes its sending addresses. Use it only with a service that updates the record automatically, or prefer removing old includes and using a subdomain.
Do ip4 and ip6 mechanisms count toward the limit?
No. Mechanisms that do not need a DNS query, ip4, ip6 and all, are free under RFC 7208, which is why replacing includes with direct ranges lowers your count.
Where to from here
The free privacy policy audit reads your published privacy policy against the Australian Privacy Principles and tells you what is missing. Privacy Care keeps your policy and your shopper data practices current for AU$149 a month, with a 3-month minimum. Would it be okay if we showed you what the audit finds? A no is welcome.
Sources
- RFC 7208, Sender Policy Framework (SPF), section 4.6.4 evaluation limits
- RFC 7489, DMARC
- Google, email sender guidelines
- ASD, Essential Eight overview
General information, not legal advice. Laws and guidance change: check the linked primary sources and ask a qualified adviser about your own situation. Written by Kyle Deligny with AI assistance, last reviewed 1 December 2026. How we write and check: editorial policy.
