SPF lookup counter: fix "too many DNS lookups"
An SPF lookup counter expands your SPF record the way a receiving server does and counts the DNS lookups it costs. RFC 7208 allows 10; every include, a, mx, ptr, exists and redirect counts, including those nested inside includes. Over 10, SPF returns permerror and fails. Enter a domain to see the count and the full include tree.
Follows every include and redirect from a public resolver. 10 lookups a minute.
Sample result
acme.example's SPF uses 5 of its 10 allowed lookups, so it's within the limit.
- SPF lookups
- acme.example
- Heaviest
- _spf.google.com (4)
- Void lookups
- 0 of 2
What this means for you
Go over 10 and SPF fails outright, so leave room before adding another sending tool.
- Expands every include and redirect
- Counts lookups against the limit of 10
- Counts void lookups against the limit of 2
- Shows which include costs the most
- SPF
- Lookups
- permerror
By SimpleVerifier Team · Last updated
How do I check how many DNS lookups my SPF record uses?
- Enter your domain, or any email address at it.
- Press Count lookups. The tool reads the SPF record from a public resolver and follows every include and redirect.
- Read the total against the limit of 10, then the list of top-level includes ranked by what each one costs.
- Open the tree to see every record and term. Remove or replace the costliest includes you don't need, then count again.
Example
- You enter
- The domain
acme.example. - You get
- 5 of the 10 allowed DNS lookups, so it's within the limit, with 0 of 2 void lookups. The heaviest include is
_spf.google.comat 4 lookups, thensendgrid.netat 1. - Limits
- One domain per check and 10 checks a minute per connection; at most 40 SPF records are read per domain.
What is the SPF lookup limit?
The SPF lookup limit is 10 DNS lookups per evaluation. RFC 7208, section 4.6.4 says implementations must limit the terms that cause DNS queries, which are the include, a, mx, ptr and exists mechanisms and the redirect modifier, to 10, and must return permerror when a record goes over. The ip4, ip6 and all mechanisms cost nothing.
The count is for the whole tree, not the top-level record. include:_spf.example.net costs one lookup, plus everything inside _spf.example.net's own record. That's why a record with six includes can cost 12: vendors nest their own includes. The same section sets a second limit: lookups that return no answer (void lookups) should stop at two. This tool counts both.
How do I fix SPF too many DNS lookups?
Find what each include costs, then cut from the top. Start with services that no longer send as your domain: old newsletter tools, a CRM you left, a test account. Then replace a and mx mechanisms with the ip4: ranges they point at, when those servers are yours and their addresses don't change. Each of these saves at least one lookup.
If you're still over, split the sending. Put cold email or marketing on a subdomain such as mail.yourdomain.com with its own SPF record, so each record carries only the services that use it. Also check whether a platform needs an include at all: SPF is checked against the envelope sender (Return-Path), and many platforms use their own bounce domain there, so your include does nothing for them. Our worked example, fixing SPF too many DNS lookups, walks a real domain from 13 lookups to under 10.
What is SPF flattening?
SPF flattening replaces include: mechanisms with the IP ranges they currently resolve to, so the record costs fewer lookups. It works, but it freezes a vendor's addresses into your record: when the vendor adds or changes ranges, mail from the new addresses fails SPF until you flatten again. Use it only with something that re-flattens automatically, and try removing includes first. The glossary entry on SPF flattening covers the trade-off.
How many SPF includes can you have?
There's no separate cap on includes; what's limited is the total lookups they cause. Ten includes of flat vendor records (each a list of IP ranges) sits exactly at the limit; three includes of vendors that nest further includes can be over it. You can only have one SPF record per domain, though: two v=spf1 TXT records is itself a permerror, which this tool also flags.
Microsoft's own SPF guide for Microsoft 365 makes the same point about the limit (Microsoft Learn), and Google lists SPF among the requirements for bulk senders to Gmail (email sender guidelines). A record over the limit fails both.
How is this different from an SPF checker?
| This lookup counter | SPF checker | dig by hand | |
|---|---|---|---|
| Counts nested includes | Yes, the full tree | Top level only | One query at a time |
| Ranks includes by cost | Yes | No | No |
| Void lookups (limit 2) | Counted | No | Manual |
| Explains the record's policy | Ends-with (all) only | Yes | No |
By hand: dig +short TXT yourdomain.com, then repeat for every include you find and add up the lookup terms.
Who uses this tool, and for what?
- Cold emailers
- Check each sending domain after adding Instantly, Smartlead or a warmup tool's include, before the record quietly goes over 10.
- Agencies
- Audit client domains that have collected years of includes, and show them which vendor is costing the most.
- IT and email admins
- Diagnose intermittent SPF permerror, where mail matching an early mechanism passes and mail from a later sender fails.
- Marketing ops
- Before adding a new ESP, see how many lookups are left and whether it should go on a subdomain instead.
What can’t this tool tell you?
- It counts what's published now, from one public resolver. Records cached elsewhere may differ until their TTL expires.
- Macros such as %{i} are expanded per message, so their targets can't be followed. They're counted as one lookup each and flagged.
- It doesn't tell you whether a particular sending IP passes; that depends on the message. Read Authentication-Results in a received message's headers for that.
- To keep the check bounded it reads at most 40 SPF records per domain; trees that large are already far over the limit.
Common questions
- What is the SPF lookup limit?
- Ten DNS lookups per evaluation, set by RFC 7208 section 4.6.4. include, a, mx, ptr, exists and redirect each count, including those inside included records; ip4, ip6 and all don't.
- How many SPF lookups do I have?
- Enter your domain above. The counter follows every include and redirect, adds up the lookups, and shows which top-level include accounts for most of them.
- How to fix SPF too many DNS lookups?
- Remove includes for services that no longer send as you, replace a and mx with the IP ranges they resolve to, and move marketing or cold email to a subdomain with its own record. Flatten only as a last resort.
- What are SPF lookups?
- The DNS queries a receiving server makes while evaluating your SPF record: one for each include, a, mx, ptr and exists mechanism and for redirect, plus the lookups inside every record those point to.
- How many SPF records can you have?
- One per domain. Publishing two TXT records that start v=spf1 makes SPF return permerror for every message. Merge them into one record.
- What is SPF flattening?
- Replacing include: mechanisms with the IP addresses they resolve to, to cut lookups. It goes stale when a vendor changes its IPs, so it needs automatic re-flattening.
- What is a void lookup in SPF?
- A lookup that returns no records or a non-existent domain. RFC 7208 says receivers should stop after two, so includes or a mechanisms pointing at names that don't exist can also cause permerror.
Sources
Embed this tool on your site
Paste this code into any page to give your readers the SPF lookup counter for free. The frame resizes to fit and works on light and dark pages. Keep the link under it so readers can find the full guide. More tools to embed are on the embeddable tools page.
<iframe src="https://simpleverifier.com/embed/tools/spf-lookup-counter" title="SPF lookup counter by SimpleVerifier" data-sv-embed="spf-lookup-counter" width="100%" height="640" loading="lazy" allow="clipboard-write" style="border:0;width:100%;max-width:760px;display:block"></iframe>
<p style="margin:6px 0 0;font-size:13px"><a href="https://simpleverifier.com/tools/spf-lookup-counter">Free SPF lookup counter by SimpleVerifier</a></p>
<script>(function(){if(window.__svEmbed)return;window.__svEmbed=1;window.addEventListener("message",function(e){if(e.origin!=="https://simpleverifier.com")return;var d=e.data;if(!d||d.type!=="simpleverifier:embed-height"||typeof d.slug!=="string"||typeof d.height!=="number"||!isFinite(d.height))return;var f=document.querySelectorAll("iframe[data-sv-embed]");for(var i=0;i<f.length;i++){if(f[i].contentWindow===e.source){f[i].style.height=Math.min(Math.max(Math.ceil(d.height),200),4000)+"px";}}});})();</script>You audited one domain. Cold outreach means thousands.
This tool checks a domain you type in. It will not tell you which addresses at that domain are real.
- Bulk mailbox verification with real SMTP checks
- The email finder — name plus company to a verified address
- Website enrichment for emails, owner names and socials
One plan, cancel anytime, no contract. Sign in with Google and your first 100 email checks are free, no card. The free tools stay free either way.