Guide ·
The SPF 10 DNS lookup limit: why it is exceeded and how to fix it
By: Kemal Özleyen, Cybersecurity Engineer · Check Point Workspace Security Expert · Kinetik Bilişim
Under RFC 7208 an SPF evaluation may involve at most 10 terms that cause DNS lookups; beyond that the result is permerror and SPF does not work at all. include, a, mx, ptr, exists and redirect count; ip4, ip6 and all do not.
The rule
RFC 7208 §4.6.4 counts the terms that cause DNS lookups: the include, a, mx, ptr and exists mechanisms and the redirect modifier. Across the whole evaluation their total may not exceed 10; if it does, the result is permerror. Terms inside records pulled in by include count as well, so the limit applies to the whole chain, not to a single record.
Two further limits apply: each mx mechanism may lead to at most 10 address (A/AAAA) lookups, and a limit of two is recommended for lookups that come back empty (“void lookups”).
ip4, ip6, all and exp cause no lookups and are not counted.
Why the limit is exceeded
Every new service (mail platform, newsletter tool, help desk, invoicing software) adds an include, and that include may carry further includes of its own. The record looks short but the chain is long. When a provider changes its own record, the limit can be exceeded without you touching anything.
Count first
Do not guess; resolve the chain. Mailskop’s SPF chain view (/en/check/<domain>/spf) follows every include to the end and shows how many lookups each branch uses.
What to fix, in order
- Delete what you no longer use. An
includefor a provider you have left keeps consuming lookups. - Remove
ptr. RFC 7208 §5.5 marks this mechanism “do not use” and says it should not be published. - Remove unnecessary
aandmx. If your web server or inbound mail server does not send mail, these terms only spend lookups. - Move bulk sending to a subdomain. A subdomain such as
news.example.comhas its own SPF record and its own budget of 10 lookups. Because DMARC’s default alignment is relaxed (aspf=r), mail sent with the subdomain still aligns with the parent domain. - Use flattening only as a last resort. Writing the provider’s IP addresses as
ip4/ip6instead of anincludespends no lookups, but when the provider changes its addresses your record goes stale without warning. Only do this if you can update the list automatically.
The other side of the same mistake: more than one SPF record
Adding a second v=spf1 record to stay under the limit does not work: under RFC 7208 §4.5 a domain with more than one SPF record gets permerror straight away. In Mailskop’s September 2026 measurement, 89 of 8,208 .tr domains whose SPF records could be counted had more than one. Merge them into one.
Wrong — two records:
ornek.com.tr TXT "v=spf1 include:spf.protection.outlook.com -all"
ornek.com.tr TXT "v=spf1 include:_spf.google.com ~all"
Right — one record:
ornek.com.tr TXT "v=spf1 include:spf.protection.outlook.com include:_spf.google.com -all"
Frequently asked
~all or -all?
~all or -all?Neither spends a lookup; they are unrelated to the limit. The SPF lookup page explains the difference.
Is my mail rejected as soon as the limit is exceeded?
The SPF result becomes permerror, so SPF never authenticates. What happens to the message depends on the receiver and your DMARC policy: if DKIM is aligned, DMARC can still pass.
Other guides
- From RFC 7489 to RFC 9989: what to change in your DMARC record
- DMARC from
p=nonetop=reject, step by step - Setting up SPF, DKIM and DMARC for Microsoft 365
- Setting up SPF, DKIM and DMARC for Google Workspace
- Gmail, Yahoo and Outlook bulk sender requirements
- Email header analyzer comparison: Mailskop, MxToolbox, Microsoft and Google
- Where was an email sent from? Tracing its route and IP location from the header
- Measurement: Email security measurement, September 2026: DMARC, SPF and DKIM across 21,197 domains
Last updated: