SPF check: is your SPF record valid and under the 10-lookup limit?
How does this check work, and what does the result tell you?
Yes, free and with no account: AdminKit walks your domain's SPF record the way a receiver does, through nested includes and stopping at "all", counts DNS lookups against RFC 7208's limit of 10 and void lookups against its limit of 2, flags syntax errors as permerrors, and explains how strict the trailing "all" mechanism is.
Part of the Email authentication cluster — more tools, guides and terms on email authentication.
AI explanation Run a check below, then sign in to ask AI to explain the result in plain language.
Keep this result
Copy a link to this check so you can share it or run it again later. Want a heads-up when this result changes? Talk to our team and we'll set it up for you.
How it works and limits
This tool parses your domain’s SPF (Sender Policy Framework) TXT record with AdminKit’s own code — no third-party
mail-auth library — and walks it the way a receiver evaluates it: terms left to right, through nested includes,
stopping at the first all. It counts every include, a, mx, ptr, exists and redirect it reaches to show
how many DNS lookups evaluating the record actually costs.
What the walk does, term by term:
- Terms after
allare skipped. Receivers never evaluate them, so they cost no lookups. redirect=is followed only when the record has noall, as RFC 7208 §6.1 specifies. Whenallis present, theredirectis ignored and costs nothing; a findings note says so, and the redirect target is not queried.a,mxandexiststargets are resolved (A and AAAA, MX, A) to count void lookups: answers that come back empty or NXDOMAIN.- Targets written with
%{…}macros are counted but not followed. They depend on the sending IP or address, which a domain check does not have. ptris counted and noted. RFC 7208 §5.5 says not to use it.- Syntax errors are permerrors: an unknown mechanism, a malformed
ip4/ip6network or CIDR length,includeorexistswithout a domain, an argument onall, or tworedirects. Onlyaandmxtake a CIDR length (a/24,mx//64,a:example.com/24//64, RFC 7208 §5.6): 0-32 after/, 0-128 after//, no leading zeros. Oninclude,existsorptrit is a syntax error. - An
includeorredirecttarget with no SPF record, or with more than one, is a permerror. So is an include or redirect loop.
If your domain has no SPF record yet, or you want to draft one before publishing, AdminKit’s SPF record generator assembles the TXT record string in your browser.
Why the lookup count matters
RFC 7208 caps SPF evaluation at 10 DNS lookups
(§4.6.4, “DNS Lookup Limits”) specifically to bound the
cost of checking a single record. A record that exceeds the limit is treated by receivers as a permanent error
(“permerror”) — mail authentication effectively stops working for the whole domain, often silently, until someone
notices deliverability dropping. Common causes are stacking too many third-party mail-sending services (include:)
without consolidating them. Microsoft’s
SPF setup guide makes the
same point about nested includes: “having fewer than 10 include: statements doesn’t guarantee fewer than 10 DNS
lookups.”
Reading the “all” mechanism
The trailing all term decides what happens to mail that matches nothing else in the record:
-all— fail: reject mail that doesn’t match.~all— softfail: flag it as suspicious, but don’t reject outright.?all— neutral: no real effect.+all— pass: anyone can send as this domain, almost always a mistake.
No all term at all behaves like ?all. Mailbox providers differ on which to publish: Google’s
Workspace guide to setting up SPF recommends ~all, which tells receiving servers to mark mail from
unlisted servers as spam rather than reject it.
-all, ~all, ?all and +all only describe the trailing mechanism, not the full set of outcomes a check can
return — see what an SPF check result actually means for all seven
possible results, including PermError and TempError.
How to read the results
- SPF record — the exact TXT record the check found at your domain. If nothing is shown, the domain has no SPF record, or publishes more than one.
- DNS lookups (limit 10) — the lookup-causing terms counted through every nested include. Green means within the limit. Red means over it: the walk stops at the 11th lookup, so the count reads 11 and the finding says “at least 11”.
- Void lookups (limit 2) — how many
a,mxorexistslookups came back empty or NXDOMAIN. A SERVFAIL or timeout on one of those targets is not counted as void. Red means more than 2. - permerror — shown when anything above makes receivers return a permanent error: over 10 lookups, over 2 void
lookups, a syntax error, an include/redirect target without exactly one SPF record, or a loop. The finding names
the cause. The
allexplanation is left out then, because receivers never reach it. - All mechanism — the
allthat decides unmatched mail: the record’s own, or the redirect target’s when the record delegates withredirect=. Explained above. - Findings — plain-language notes: the lookup count, any permerror cause, a note for
ptror%{…}macros, a note for a mechanism written with=(such asinclude=xinstead ofinclude:x: an unknown modifier that receivers ignore, so it is not followed or counted), a note whenredirect=is ignored because the record hasall, and what theallmechanism (or its absence) asks receivers to do. More than one SPF record replaces all of this with a single “merge them” finding. - All mechanisms seen — every term of every record the walk fetched, including terms after
allthat were not evaluated. Useful to spot which vendor’s include uses the most lookups. - Error instead of a result — the DNS query for your domain’s own TXT records failed (for example SERVFAIL). That is not the same as “no SPF record”, so run the check again.
Examples
These rows come from running AdminKit’s SPF code against a fake DNS resolver for example.com (all names are
documentation names; the vendor record is v=spf1 ip4:198.51.100.0/24 ~all).
| Record | Lookups | Void | Result |
|---|---|---|---|
v=spf1 ip4:192.0.2.0/24 -all | 0 | 0 | -all (fail). Only that range may send. |
v=spf1 mx include:_spf.example.net ~all | 2 | 0 | ~all (softfail). Your MX hosts and one vendor may send. |
v=spf1 -all include:_spf.example.net | 0 | 0 | -all. The include comes after all, so it is never evaluated. |
v=spf1 redirect=_spf.example.net ~all | 0 | 0 | ~all, plus a note: the record has all, so redirect is ignored (RFC 7208 §6.1). |
v=spf1 redirect=_spf.example.net (target ends in -all) | 1 | 0 | -all, taken from the redirect target. |
v=spf1 exists:%{i}._spf.example.com -all | 1 | 0 | -all, plus a note: macro targets are counted, not followed. |
v=spf1 ptr -all | 1 | 0 | -all, plus a note that RFC 7208 §5.5 says not to use ptr. |
v=spf1 a:old1.example.com a:old2.example.com -all, both names NXDOMAIN | 2 | 2 | -all. Two void lookups are still allowed. |
Same with a third a:old3.example.com | 3 | 3 | permerror: 3 void lookups, over the limit of 2. |
v=spf1 ip4:192.0.2.300 -all | 0 | 0 | permerror: syntax error, invalid ip4 network. |
v=spf1 include:_spf.example.net -all, target has no SPF record | 1 | 0 | permerror: the include target has no SPF record. |
Eleven include: terms, then -all | 11 | 0 | permerror: “at least 11 DNS lookups”, over the limit of 10. |
v=spf1 +all | 0 | 0 | +all. Anyone may send as your domain; almost always a mistake. |
Two v=spf1 TXT records on one name | 0 | 0 | permerror before any lookup: merge them into one record. |
| The TXT query for the domain returns SERVFAIL | — | — | An error message, not “no SPF record”. |
Limits
- This checks syntax and lookup counts, not whether a specific sending IP would pass or fail — that depends on the
full mechanism list and is better observed from real delivery reports (DMARC
rua, defined in RFC 9990). For the same reason,%{…}macro targets are not expanded. - A DNS error (SERVFAIL or timeout) while fetching an
includeorredirecttarget’s record also ends the check with an error message rather than a result. RFC 7208 calls that a temporary error, not a pass or a permerror. - No query is logged; see /legal/privacy/.
- This resolves your domain’s live record over DNS. To check a record’s syntax and lookup-causing term count from text alone — before it’s published, or one copied from a vendor’s setup docs — use the offline SPF validator instead; it never performs a DNS lookup.
SPF is only one of three records that work together for mail authentication — see SPF, DKIM and DMARC explained for how it combines with DKIM and DMARC.
If a specific message already failed and you want to see what the receiving server itself reported, rather than re-checking your live DNS record, AdminKit’s email header analyzer reads that message’s raw Received chain and Authentication-Results header directly, entirely in your browser.
If this check comes back with a permerror for too many DNS lookups, see
fixing SPF “too many DNS lookups” (PermError) for what triggers the RFC 7208
10-lookup limit and how to flatten it. RFC 7208 §4.6.4 also caps a related but separate count — void lookups,
DNS queries that come back empty or NXDOMAIN — at 2, tracked apart from the 10-lookup total. See also the glossary entry for SPF, and how AdminKit’s free
checker compares to other options in the free SPF/DMARC checker roundup.
Frequently asked questions
Why does SPF have a 10-lookup limit?
10 is the hard cap: RFC 7208 states that "SPF implementations MUST limit the total number of those terms to 10 during SPF evaluation" (RFC 7208 §4.6.4), bounding the cost of evaluating a single record regardless of how many mail services a domain uses.
What does ~all vs -all mean?
-all (Fail) is the stricter of the two: RFC 7208 defines it as "an explicit statement that the client is not authorized to use the domain" (RFC 7208 §4.6.2), while ~all (SoftFail) is only "a weak statement by the publishing ADMD that the host is probably not authorized." Four qualifiers exist in total (+, -, ~, ?); -all rejects, ~all flags.
Which mechanisms count toward the 10-lookup limit?
Six term types count toward RFC 7208's 10-lookup cap (RFC 7208 §4.6.4): include, a, mx, ptr, exists and the redirect modifier, each costing one lookup, with include/redirect adding the lookups of the record they point to. ip4, ip6 and all cost nothing. Terms after all are never evaluated, and redirect is only used when the record has no all, so neither costs anything then.
Can a domain have more than one SPF record?
No — RFC 7208 treats more than one SPF-type TXT record on the same name as a permanent error: "If the resultant record set includes more than one record, check_host() produces the 'permerror' result" (RFC 7208 §4.5), the same failure mode as exceeding the lookup limit. A domain should publish exactly one SPF record.
What does it mean if no SPF record is found?
The domain publishes no TXT record starting with v=spf1, so receivers get the SPF result "none" (RFC 7208 §4.5) and cannot tell authorised senders from forgers. Publish one record; AdminKit's SPF record generator drafts it in your browser. If the DNS query itself fails (SERVFAIL), the tool shows an error instead, not "no record".