What the SPF checker tests
- Exactly one
v=spf1TXT record exists. - Every term is a valid mechanism (all, include, a, mx, ptr, ip4, ip6, exists) or modifier (redirect, exp), with valid IP syntax.
- Total DNS-querying terms, including those inside nested includes, stay within 10.
- Void lookups (2 maximum), include loops and includes with no SPF record.
- Risky qualifiers:
+all,?all, deprecatedptr, and terms afterall.
SPF syntax reference
| Term | Meaning | Counts as lookup |
|---|---|---|
ip4:203.0.113.0/24 | Authorise an IPv4 address or range | No |
ip6:2001:db8::/32 | Authorise an IPv6 address or range | No |
a / mx | Authorise the domain's A/AAAA or MX hosts | Yes |
include:_spf.google.com | Use another domain's SPF policy | Yes (plus its own) |
exists: | Match if a constructed name resolves | Yes |
redirect= | Use another domain's policy entirely | Yes |
-all / ~all | Fail / softfail everything else | No |
Qualifiers: + pass (default), - fail, ~ softfail, ? neutral.
Fixing "too many DNS lookups"
- Remove includes for services you no longer use.
- Replace
aandmxwith explicitip4/ip6where your servers are stable. - Move marketing or transactional senders to a subdomain (for example
mail.example.com) with its own SPF record. DMARC relaxed alignment still passes for the organisational domain. - Flattening into IP lists works but breaks silently when providers change IPs, so monitor it.
Need a new record? Use the SPF generator.
Frequently asked questions
What is the SPF 10 lookup limit?
RFC 7208 section 4.6.4 limits SPF evaluation to 10 mechanisms that need DNS lookups: include, a, mx, ptr, exists and the redirect modifier. Nested includes count too. Over 10, receivers return permerror and SPF fails. ip4, ip6 and all do not count.
Should I use ~all or -all?
Both are acceptable once DMARC is in place, since DMARC decides the final outcome. -all (fail) is stricter; ~all (softfail) is common and avoids hard rejections from forwarding edge cases before DMARC evaluates. Never use +all.
Can I have two SPF records?
No. A domain must publish exactly one TXT record beginning v=spf1. Two records produce permerror. Merge them into one.
What is a void lookup?
A DNS lookup in SPF evaluation that returns no records or NXDOMAIN. RFC 7208 recommends a limit of 2; more can cause permerror.