The SPF 10-Lookup Limit: What It Is and Why Going Over Breaks Email
SPF allows only ten DNS-querying terms per check. Add one service too many and the whole record can fail. Learn what counts, how to count, and how to fix it.
10 min readUpdated Nov 22, 2026By XPASS Editorial Team

The problem in one sentence
An SPF record looks like a simple list of allowed senders, but a receiving server may not follow more than ten of the terms that need DNS queries. If your record needs an eleventh, the receiver stops and returns an error instead of a pass. Mail that was fine last month can start failing the day you add one more service.
This guide explains what the limit is, which terms count, how to count them yourself, and how to get back under the limit without breaking your sending. It also connects to wider email authentication: SPF is one of the inputs to DMARC, and a broken SPF can leave you relying on DKIM alone. For how the pieces fit, read DMARC alignment explained.

What the limit actually is
SPF is defined in RFC 7208. Section 4.6.4 limits the number of mechanisms and modifiers that trigger DNS queries during the evaluation of a single check. The limit is ten. When a receiver would need to exceed it, the result must be permerror, a permanent error, rather than pass or fail.
Two things about that rule are easy to miss.
- The limit applies to the whole evaluation, not to one record. Every nested include adds its own terms to the same running total.
- The limit counts terms that cause lookups, not DNS queries one by one. An include that points to a record containing three more includes consumes one lookup for itself plus the lookups inside it.
There is also a second, smaller limit: no more than two "void lookups", meaning queries that return nothing or a non-existent domain. A stale include pointing to a name that no longer exists can therefore break a record even when the total count looks low.
Which terms count
| Term | Causes a DNS lookup? | Counts toward the 10? |
|---|---|---|
| include | Yes, fetches another record | Yes |
| a | Yes | Yes |
| mx | Yes, then resolves each mail host | Yes (and the hosts have their own cap) |
| ptr | Yes | Yes (and the RFC advises not to use it) |
| exists | Yes | Yes |
| redirect | Yes | Yes |
| ip4 | No | No |
| ip6 | No | No |
| all | No | No |
| exp | Only when an SPF failure is explained | No |
The mx mechanism has an extra detail: the receiver resolves the MX records and then looks up each host name, and RFC 7208 caps this at ten names per mx term. A domain with a long list of mail hosts can run into trouble from a single mx entry.
Each service that asks you to add an include usually has its own internal includes. A common pattern is that one include for a marketing tool expands to three or four lookups once the nested records are counted. That is how a record with only five visible terms can still exceed ten.
How to count your own record
You can count by hand with a few DNS queries. You need a tool that shows TXT records, such as dig or nslookup, or an online SPF checker.
- Query the TXT record of your domain and find the one that begins with v=spf1.
- Write down every include, a, mx, ptr, exists and redirect term. Each is one lookup.
- For each include, query that domain's TXT record and repeat steps 1 and 2 inside it. Keep a running total.
- Stop when you have followed every nested include, or when the total passes ten.
- Remember to check redirect= targets, because a redirect behaves like an include for the purpose of counting.
A worked example. Suppose your record is:
v=spf1 include:_spf.mailbox-provider.example include:spf.newsletter-tool.example include:spf.helpdesk-tool.example a mx -all
Say the mailbox provider's record contains two more includes, the newsletter tool's contains one, and the help desk tool's contains none. The count is three top-level includes, plus a, plus mx, which is five. Add the nested includes (two plus one) and you have eight. If the mx host list or a nested record contains another include or two, you reach eleven. Nothing in your own record looks wrong, but the receiver returns permerror.
Online checkers are convenient but they follow the same method. Treat their numbers as a guide and confirm the final record with a direct DNS query.
What happens when you exceed it
When a receiver returns permerror for SPF, it means the SPF check could not be completed. Different receivers react in different ways, and RFC 7208 does not say that a message must be rejected. In practice you may see:
- Mail delivered to the spam folder or flagged as suspicious.
- Mail rejected outright at SMTP time, especially if your DMARC policy is strict and DKIM does not rescue the message.
- Mail accepted normally by lenient receivers, which makes the problem hard to notice.
Because the behavior varies, this failure often shows up as vague complaints such as "some customers do not get our mail". DMARC reports show it more clearly: look for rows where SPF is reported as permerror. If DKIM is aligned for the same sender, DMARC can still pass, which is another reason to configure DKIM for every service. The article on DKIM selectors and key rotation explains how to keep that safety net healthy.
Practical ways to get under the limit
Work from the safest fix to the most invasive one.
- Remove services you no longer use. Old newsletter tools, trial accounts, and former hosting providers often stay in SPF for years. Deleting an unused include carries little risk once you have confirmed that nothing sends from it.
- Replace a and mx with ip4 or ip6 where the addresses are stable. If your own server has a fixed IP, an ip4 term costs nothing against the limit.
- Avoid ptr completely. It is slow, unreliable, and discouraged by the standard.
- Move marketing and transactional senders to subdomains. For example, publish a separate SPF record for news.example.com and send newsletters from that subdomain. Each subdomain gets its own ten lookups. This also keeps your main domain record short.
- Use a return-path subdomain at the service. Many providers let you set a custom bounce domain whose SPF record is managed by them, so you do not need their include in your main record at all. This also helps alignment as described in our DMARC guide.
- Consider flattening, with caution. Flattening replaces includes with the underlying ip4 and ip6 lists. It cuts lookups but also freezes a snapshot. If the provider adds or changes servers, your record becomes wrong silently. Use flattening only with an automated tool that refreshes the list, or with a provider you trust to publish a stable range.
- Do not publish two SPF records. A domain must have exactly one TXT record that starts with v=spf1. Having two is itself a permerror, and it is a frequent mistake when people try to split a record to work around the limit.
Length limits you may also hit
Lookups are not the only constraint. A single DNS TXT string can hold at most 255 characters, so long SPF records are split into several quoted strings that DNS software joins together. Most DNS control panels handle this for you, but a manual edit can introduce stray spaces or quotes. A very long record can also push the DNS response past the size that works comfortably over older UDP limits, which can cause resolvers to retry over TCP. Keeping your record short reduces both problems.
If you manage DNS records yourself, our guide to starting DMARC for a small business includes a short checklist for editing authentication records safely and verifying them afterwards.
Limits and what to watch for
- The ten-lookup limit is set by the standard, not by your DNS host. Changing providers will not raise it.
- Third parties can change their own nested includes at any time. A record that counted eight last quarter could count eleven today. Re-check after any service notice, and after any change in who sends mail for you.
- Counting tools may disagree. Some count only the top level, some stop at nested records they cannot resolve. Always verify with a real query.
- Softfail (~all) or neutral (?all) does not remove the limit. The record is still evaluated the same way, and permerror still occurs.
- Aggressive flattening can make a record exceed the length limit instead of the lookup limit.
- Changing SPF alone cannot repair spoofing. Pair it with DKIM and DMARC; no single record is a complete defence, and the steps in starting DMARC for a small business show how the layers fit together.
A short worked fix
A small online shop has one SPF record with six includes: a mailbox provider, a newsletter tool, an order-notification tool, a help desk, an old survey tool, and an abandoned cart plug-in that was removed last year. A checker reports twelve lookups, and DMARC reports show SPF permerror for the order notifications.
The owner first confirms through DMARC reports that nothing has sent via the survey tool or the plug-in for three months and removes both includes. The count drops to eight. The owner then asks the order-notification tool to use a custom return-path on notify.example.com and removes its include from the main record. The count drops to six. The next DMARC report shows SPF passing again, and DKIM aligned for each service. The fix took no new software and no flattening, only housekeeping.
A maintenance routine that prevents surprises
SPF problems rarely appear on the day you make a change. They appear months later, when a provider quietly edits a nested record. A light routine avoids most of these surprises.
- Keep a simple list of every service allowed to send as your domain, with the name of the person who owns it and the date it was added.
- Whenever a team signs up for a new tool that sends email, ask for the DNS records first. A new include should be a decision, not an accident.
- Once a quarter, run the counting steps again and note the total. If it is eight or nine, plan the cleanup before you need the eleventh.
- Compare your DMARC aggregate reports with the list. A sender that appears in reports but not on the list is either a forgotten tool or something that should not be sending.
- After removing an include, wait for the TTL of the old record to pass and watch the reports for any legitimate source that suddenly fails.
Small habits like these cost very little compared with a day spent explaining to customers why their invoices never arrived.
Summary
SPF permits at most ten lookup-causing terms per evaluation, counting include, a, mx, ptr, exists and redirect, including those nested inside other records. Exceeding the limit yields a permerror, and the result for your mail then depends on each receiver and on your DMARC policy. Count by following every include, trim unused services first, move senders to subdomains or custom return-paths, and flatten only with automation and care. Always keep exactly one SPF record, and keep DKIM aligned as a backup. To see how managed email authentication can simplify this, browse the Email Security and Business Email pages.
Frequently asked questions
What is the SPF 10-lookup limit?
RFC 7208 lets a receiver perform at most ten DNS lookups caused by the mechanisms include, a, mx, ptr, exists and the redirect modifier while evaluating one SPF record. Going beyond that produces a permanent error.
What happens when my SPF record exceeds ten lookups?
The evaluation ends with a permerror result. Receivers treat it as a failed or unusable SPF check, and depending on their rules and your DMARC setup, mail may be rejected, filtered to spam, or accepted with a penalty.
Which SPF terms do not count toward the limit?
The ip4, ip6 and all mechanisms do not cause DNS lookups, so they do not count. The exp modifier is also not counted toward the limit.
Is SPF flattening a good fix?
It can work, because it replaces include terms with IP addresses. But the addresses can go stale when a provider changes them, so flattening needs automation or regular review. Removing unused services is a safer first step.
References
About the author

Bob Kanokphon Thongdee
- Founder of XPASS VPN
- Co-founder of eSIMonline.asia
- More than 7 years in online marketing
- Founder of Cojourney Visa and Cojourney Travel
Protect your email and stop spoofing
Spam filtering and DMARC monitoring for your domain.
See email securityKeep reading

Business Email Guides
DMARC Alignment Explained: Why SPF and DKIM Passing Is Not Enough
DMARC does not only ask whether SPF or DKIM passed. It asks whether the passing domain matches the From address people see. Here is how alignment works and how to fix it.
10 min read

Business Email Guides
What Is a DKIM Selector, and When Should You Rotate Your Keys?
A DKIM selector is the label that tells receivers which public key to use. Learn how selectors work, when to rotate keys, and a safe step-by-step rotation.
10 min read

Business Email Guides
How to Start Using DMARC for a Small Business
DMARC does not have to be intimidating. Follow a gradual plan that starts with monitoring, finds every sender and ends with a policy that blocks forged mail.
10 min read