What SPF does
SPF (Sender Policy Framework) is a TXT record on your domain that lists the servers allowed to send mail for it. When a message arrives, the receiving server looks at the address it came from, reads your SPF record and checks whether that server is on the list.
A record looks like this: v=spf1 include:_spf.google.com include:klaviyomail.com ~all. Each include: hands the question to another record, usually your email provider's. The all at the end says what to do with every server not on the list.
The ending: -all, ~all, ?all
- -all (fail): mail from any other server should be rejected. The strictest setting.
- ~all (softfail): accept it, but mark it as suspicious. The usual choice, and safe while DMARC does the enforcing.
- ?all (neutral): say nothing. Barely better than no record.
- +all: anyone may send as you. Never use it.
With DMARC at quarantine or reject, ~all is fine: DMARC decides, and a softfail keeps a forwarded message from bouncing outright.
The 10-lookup limit
SPF allows at most 10 DNS lookups while a record is evaluated. Every include:, a, mx, ptr, exists: and redirect= costs one, and so does everything inside the records they point to. Google Workspace alone uses about 4; add Microsoft 365, a newsletter tool, a helpdesk and an invoicing service and you are over the limit without noticing.
Past 10 lookups the result is a permanent error, and receivers treat SPF as failed for every message, including the legitimate ones. Mail still arrives when DKIM passes, but you have lost half of your DMARC protection.
This checker follows every include, counts each lookup and shows where they come from, so you can see which service is the expensive one.
How to get back under 10
- Remove includes for services you no longer use. Old records collect them for years.
- Replace a/mx with ip4: or ip6: entries when the addresses rarely change: IP ranges cost no lookups.
- Send marketing mail from a subdomain (news.your-store.com) with an SPF record of its own.
- Check whether a service signs with DKIM on your domain instead: many ESPs pass DMARC through DKIM alone, so their include is not needed.
Avoid "SPF flattening" services that copy every IP into your record unless they keep it updated for you: when the provider adds a server, flattened records go stale silently.
After every change, run the check again. DNS answers are cached for a while, so give a new record a few minutes. Keep a note of why each include is there, so the next person can tell which ones are still in use.
There is a second limit that fewer tools check: at most two lookups may come back empty (a "void" lookup, such as an include of a domain that no longer exists). A third one is also a permanent error.
Other mistakes the checker catches
- Two SPF records on the same domain: both are ignored. Merge them into one.
- An include that points to a domain with no SPF record, often a typo or a provider that changed its name.
- A record with no all at the end, which says nothing about other servers.
SPF checks the hidden Return-Path address, not the From line people see. DMARC compares the two, so check your DMARC and DKIM next.