What an SPF record is and where it lives
SPF (Sender Policy Framework, RFC 7208) is a TXT record at the root of your domain that lists the servers allowed to send mail for it. Receivers check the envelope sender (the Return-Path address used during delivery, not the visible From) against it. A typical record: v=spf1 include:_spf.google.com ip4:203.0.113.10 -all.
Mechanisms are evaluated left to right and the first match wins. ip4 and ip6 match addresses, a and mx match the domain’s own hosts, include checks another domain’s SPF policy, and all matches everything left. Each can carry a qualifier: + pass (the default), - fail, ~ softfail or ? neutral.
SPF applies to one exact domain name. Subdomains do not inherit it, so a subdomain that sends mail, or a bounce domain your email service uses, needs its own record.
How to read your SPF check results
This checker reads the TXT records at the domain apex, finds the one that starts with v=spf1, and lists every mechanism in order with its qualifier. It also shows the lookup count as “N of 10” and the final all term.
The lookup count covers the terms in the record itself that trigger DNS queries: include, a, mx, exists, ptr and redirect. Each include can add more lookups inside the record it points to, and those count toward the same limit. Treat the number as a minimum: a record showing 6 can exceed 10 once includes are expanded.
Findings flag multiple SPF records, +all, a softfail or neutral all, a missing all, the deprecated ptr mechanism, and records longer than 450 bytes.
SPF’s 10 DNS lookup limit
RFC 7208 caps SPF evaluation at 10 terms that cause DNS lookups, counted across the record and everything it includes. Go over and the result is permerror: SPF does not pass, so DMARC has to rely on DKIM alone. ip4, ip6 and all cost no lookups.
There is a second limit: lookups that return no answer (void lookups) should be capped at 2, and exceeding it also returns permerror. Includes for services you have cancelled are a common cause.
To get under the limit, remove includes for services you no longer use, replace a and mx with ip4 or ip6 when the addresses are stable, and move senders such as marketing platforms to a subdomain like news.example.com with its own record. Flattening (replacing includes with IP lists) works, but it breaks silently when a provider changes its addresses. SPF records explained goes deeper.
Common SPF errors and how to fix them
Two SPF records. A domain must have exactly one TXT record starting with v=spf1. With two, receivers return permerror for all of your mail. Merge them into one, such as v=spf1 include:_spf.google.com include:sendgrid.net -all. This usually happens when a new service’s setup guide says “add this TXT record” and the old one stays.
+all or no all. +all authorizes every server on the internet. With no all term, unlisted senders get a neutral result and are not flagged. End the record with -all or ~all.
ptr in the record. RFC 7208 says ptr should not be used because it is slow and unreliable. Replace it with ip4, ip6 or an include from your provider.
Record too long. A single TXT string holds up to 255 characters. Longer records must be split into several quoted strings in the same record, which receivers join without spaces. Keep the whole record under about 450 bytes so the DNS answer fits in one UDP packet.
SPF, DMARC and the choice between -all and ~all
Passing SPF is not enough for DMARC. The envelope sender domain that SPF checked must align with the From domain. Many email services use their own bounce domain, so SPF passes for them, not for you. Set up a custom return path on your domain, or rely on aligned DKIM: check it with the DKIM checker and your policy with the DMARC checker.
Once DMARC is at enforcement, -all and ~all both work. RFC 7489 notes that some receivers act on an SPF hard fail before DMARC runs, which can reject a forwarded message that DKIM would have passed. That is why many domains with an enforcing DMARC policy keep ~all. This checker shows ~all as a warning, not an error.
A domain that sends no mail should publish v=spf1 -all, together with a DMARC p=reject policy, so nobody can use it to send.
Frequently asked questions
How do I check my SPF record?
Enter your domain in this SPF checker. It finds the TXT record that starts with v=spf1, lists every mechanism, counts DNS lookups and flags errors. From a terminal, dig TXT example.com shows the raw record.
Can I have two SPF records?
No. A domain must publish exactly one SPF record. With two, receivers return a permanent error and SPF fails for all of your mail. Merge the mechanisms from both into a single v=spf1 record.
What is the SPF 10 lookup limit?
RFC 7208 allows at most 10 DNS-querying terms (include, a, mx, exists, ptr and redirect) during one SPF check, including those inside included records. Over the limit, SPF returns permerror and does not pass. Remove unused includes or replace them with ip4 and ip6 ranges.
Should I use -all or ~all in SPF?
-all tells receivers to fail unlisted senders, ~all marks them as a softfail. With DMARC at p=quarantine or p=reject, DMARC decides the outcome, and ~all avoids early rejection of forwarded mail at receivers that act on SPF before DMARC. Either is far better than +all or no all at all.
How do I add a new sender to my SPF record?
Add the include or IP range your provider gives you to your existing record, before the all term. Do not publish a second SPF record. Recheck the lookup count afterward, since each include adds at least one lookup.
Does SPF apply to subdomains?
No. SPF is checked against the exact domain in the envelope sender, and subdomains do not inherit the parent’s record. Each subdomain that sends mail needs its own SPF record.
Is SPF enough to stop email spoofing?
No. SPF only checks the envelope sender, which recipients never see, so a spoofer can pass SPF with their own domain while showing yours in the From header. DMARC closes that gap by requiring SPF or DKIM to align with the From domain.