SPF Lookup Counter & Flattener
Will this SPF record exceed the 10-DNS-lookup limit and fail with permerror — and which include is responsible?
An SPF record may cause at most 10 DNS lookups when a receiver evaluates it — more than that, and the receiver must return permerror and SPF fails. Enter a domain and this checker expands its SPF record live, counts every lookup term by term, counts the void lookups, and builds a flattened record of plain ip4/ip6 addresses you can paste back into DNS. Or paste a proposed record first and test it before publishing. The companion article SPF 10-Lookup Limit & Flattening Guide explains the limit, the three fixes, and the flattening trade-off. For SPF as one line among MX, DMARC and DKIM, see the Email Deliverability Check; for raw DNS records, the DNS Lookup.
Last updated:
1. Choose an input
Results
SPF lookup score
Lookup budget
Record checked
Expansion tree — what each term costs
Flattened record — paste into DNS
Findings
🔒 Domain checks run on the SysOSX checker server, which reads the domain’s public TXT records live — nothing is uploaded from your browser, and no report is stored. Pasted records are expanded by the same server; the demos run entirely in your browser against a built-in fixture.
The 10-lookup limit in one paragraph
SPF (Sender Policy Framework, RFC 7208) is a TXT record starting v=spf1 that lists which servers may send mail for a domain. When a receiver checks a message, it evaluates the record term by term — and some terms cost a DNS lookup: include:, a, mx, ptr, exists, and redirect=. Terms that name addresses directly — ip4:, ip6: — and the final all cost nothing.
Section 4.6.4 of RFC 7208 sets the budget: an evaluation may cause at most 10 DNS lookups, and a receiver that counts more must return permerror — a permanent error, which fails SPF. The same section caps void lookups — lookups that return an empty answer or NXDOMAIN — at 2. Records grow past the limit quietly: every SaaS sender you add is another include:, and each include hides its own includes, so Google plus Microsoft plus SendGrid plus Salesforce plus Zendesk routinely adds up to more than 10 before anyone notices.
Flattening is the fix this tool builds for you: replace the include:/a/mx terms with the concrete ip4/ip6 addresses they resolve to, so the flattened record costs 0 lookups. The price is staleness — the flattened IPs are a snapshot, and if a provider changes its sending IPs the record goes stale and mail fails — so a flattened record is a record you re-flatten on a schedule, never set-and-forget.
What this checker does — and what it does not
In domain mode, the SysOSX checker server fetches the domain’s TXT records, finds the SPF record, and expands it live: every include and redirect target is resolved, every a/mx target is resolved to IPs for the flattened record, and every lookup is counted against the RFC 7208 budget, including the void ones. In paste mode, the record you paste is parsed in your browser first, then sent to the same endpoint, which expands its terms against live DNS — so you can test a record before publishing it. Scoring and findings are computed in your browser from the raw facts.
It does not send mail, and it cannot tell you whether a provider has changed its IPs since the flatten, whether your mail aligns under DMARC, or what your actual sending IPs are — only what the record says. Receivers also count at the margins slightly differently (notably around mx host lookups and exists: evaluation), so a record at exactly 10 lookups is worth flattening anyway.
The demos are local expansions against a built-in fixture, labelled as demos. The heavy demo is a record with nested includes that costs 12 lookups with 1 void lookup, a ptr term and a ~all ending, and scores 49 — Poor, with a permerror banner. The clean demo costs 3 lookups with a -all ending and scores 99. Both run entirely in your browser; nothing is fetched.
Be honest about what this checker proves
The check runs from the SysOSX checker server against public DNS. The results reflect what is published, as seen from that server — not what any specific receiver enforces. A receiver may count edge cases differently, cache records longer than you expect, or apply its own limits on top of RFC 7208.
A flattened record is a snapshot, not a fix you set once. Providers change sending IPs without notice; a flattened record that was correct last month can silently fail mail today. Re-flatten on a schedule and whenever a sender is added or removed.
The checker sees the record, not your mail. It cannot tell you which IPs your senders actually use, whether a provider’s include points at IPs you never send from, or whether your DMARC alignment passes — those need a received message’s headers and a DMARC report.
DNS answers can differ during propagation. If you changed a record minutes ago, the checker may still see the cached old answer (or a resolver elsewhere may see the new one first). Re-check after the old TTL expires before treating a surprising result as final.
Key facts
| SPF | Sender Policy Framework (RFC 7208): a TXT record starting v=spf1 that lists which servers may send mail for a domain. Receivers check the sending server against it. |
| 10-lookup limit | RFC 7208 section 4.6.4: evaluating an SPF record may cause at most 10 DNS lookups. A receiver that counts more must return permerror, and SPF fails. |
| Void lookup | A DNS lookup that returns an empty answer or NXDOMAIN. More than 2 void lookups in one evaluation is a permerror. |
| include: | An SPF mechanism that pulls in another domain’s SPF record — and all of its lookups. Each include hides its own includes, which is how records grow past 10. |
| Flattening | Replacing include:/a/mx terms with the concrete ip4/ip6 addresses they resolve to, so the record costs 0 lookups — at the price of going stale when a provider changes IPs. |
| permerror | Permanent error: the receiver could not evaluate SPF at all, so SPF fails — usually too many lookups, too many void lookups, or a missing include target. |
| Score | A 0–100 score starting at 100: each error −10 (capped −50), each warning −4 (capped −28), each info −1 (capped −10). 90+ Excellent, 70–89 Good, 50–69 Needs work, below 50 Poor. A permerror record still gets a number — the red banner is the headline. |
| Official reference | RFC 7208 — Sender Policy Framework (SPF) |
Frequently asked questions
My record has 12 lookups — why does some mail still arrive?
Because not every receiver enforces the limit the same way. Strict receivers return permerror and fail SPF as RFC 7208 requires; lenient ones evaluate past the limit or cache an older, shorter record. Deliverability that depends on leniency is broken in practice: the next receiver in the chain, or the same receiver after a cache expiry, can fail the same message. Fix the record — do not rely on the receivers that let it through.
Is flattening safe? Won’t the IPs go stale?
Flattening trades one failure mode for another: it removes the lookup-limit failure and adds a staleness failure. It is safe when you re-flatten on a schedule — monthly is a common cadence — and whenever a sender is added or removed, and when the flattened record stays small enough to fit in DNS. It is unsafe as set-and-forget. If your senders change IPs often, or you cannot commit to re-flattening, prefer dropping senders you no longer use and splitting senders across subdomains instead.
Why does this checker count my includes differently from my provider’s checker?
Receivers count at the margins slightly differently — the known differences are around mx host address lookups and exists: evaluation — and some checkers do not count void lookups at all, or stop counting at the first failure. This checker follows RFC 7208 section 4.6.4 literally and shows the per-term tree, so you can see exactly which term each count comes from and compare. A record at 9 or 10 lookups is one include away from failing either way, so flatten it before arguing about the last lookup.