What this SPF checker tests
SPF (Sender Policy Framework) is a TXT record that lists the servers allowed to send email for your domain. When a message arrives, the receiving server runs an SPF check: it looks up the SPF record of the domain in the Return-Path and asks whether the sending server is on the list. A missing or broken record means a failed SPF check, and a failed SPF check is one of the fastest ways for cold email to land in spam.
The SPF checker above runs the same SPF record lookup a receiving server does, then tests everything that can go wrong:
- One record. Exactly one TXT record must start with
v=spf1. Two is an instant PermError. - Syntax. Every term must be a valid mechanism or modifier (see the SPF record syntax table). Terms placed after
alland duplicate terms are flagged. - DNS lookups. SPF allows 10. The SPF checker follows every include and redirect and counts the lookups at every level.
- Void lookups. Includes that point at domains with no SPF record, usually typos or services you stopped using.
- The all at the end.
~allor-allpass;?alland a missing all are warnings;+allfails. - Length. Records over 255 characters must be split, and very long ones cause problems.
- Your mail provider. It reads your MX records too, and warns if your mail is hosted by Google Workspace or Microsoft 365 but SPF does not authorise it, with a corrected record to copy.
It then explains your SPF record term by term, lists every IP range it authorises, and, if you enter a sender IP, runs a full SPF test to show whether that server may send.
Check SPF record: step by step
- Type your domain, or any email address on it, into the SPF record checker above.
- Optional: add a sender IP to test whether that server is allowed to send.
- Press Check SPF. Read the summary, then each check. Red breaks SPF; yellow leaves it weaker than it should be.
- Fix the record at your DNS host, wait for the TTL, and run the SPF check again.
To run an SPF record lookup from a terminal instead, use dig txt yourdomain.com +short on macOS or Linux, nslookup -type=txt yourdomain.com on Windows, or Resolve-DnsName yourdomain.com -Type TXT in PowerShell. You get the raw record, without the lookup count or the checks.
Test an SPF record before you publish it
Changing SPF on a live domain is risky: one typo and every email fails until you notice. Choose Test a record before publishing in the tool, paste your draft and press Test record. This SPF validator runs every check on the draft exactly as it would on a published record, resolving each include to count DNS lookups. Add your domain to compare it with your MX provider, and a sender IP to test it. It is an SPF record test with no risk to live mail. Publish only when it is green.
SPF test: is this IP allowed to send?
Enter a sender IP next to the domain (you find it in the Received header of a message, or in your sending tool’s settings). The SPF test evaluates the record the way receivers do, term by term and through every include, and shows which term matched:
| Result | What it means |
|---|---|
| Pass | The IP is listed. Mail from it passes SPF. |
Soft fail (~all) | Not listed. Receivers accept the mail but treat it as suspicious. |
Fail (-all) | Not listed. Receivers may reject the mail or send it to spam. |
| Neutral | Not listed, and the record gives no verdict (?all or no all). |
| PermError | The SPF record is broken, so SPF fails whatever the IP. |
SPF record syntax
An SPF record starts with v=spf1, followed by terms separated by spaces, and is read left to right until one matches. This is the full SPF record syntax:
| Term | What it does | DNS lookups |
|---|---|---|
include:domain | Authorises every server in another domain’s SPF record. How you add Google, Microsoft or a sending service. | 1, plus its own |
ip4:203.0.113.10 or /24 | Authorises one IPv4 address or range. | 0 |
ip6:2001:db8::/32 | Authorises one IPv6 address or range. | 0 |
a | Authorises the IP addresses in the domain’s A record. | 1 |
mx | Authorises the domain’s inbound mail servers. | 1 |
exists:domain | Matches if the name has an A record. Used for per-sender rules. | 1 |
ptr | Deprecated. Matches by reverse DNS. Do not use. | 1 |
all | Matches everything. Goes last and sets what happens to unlisted servers. | 0 |
redirect=domain | Uses another domain’s SPF record when nothing matches. | 1 |
exp=domain | Points to an explanation shown on failure. Rarely used. | 0 |
Each mechanism can start with a qualifier: + pass (the default), - fail, ~ soft fail and ? neutral. In practice only the one in front of all matters. The SPF record syntax is case-insensitive, and the record must be a TXT record; the old SPF record type is no longer used.
SPF record examples for cold email domains
Most cold email domains send from one provider, so the SPF record is short. Add one of these as a TXT record on the root of the domain (host @), replacing any SPF record already there. To build one for your own mix of senders, use the SPF record generator:
| You send from | SPF record example |
|---|---|
| Google Workspace | v=spf1 include:_spf.google.com ~all |
| Microsoft 365 | v=spf1 include:spf.protection.outlook.com -all |
| Google Workspace and Microsoft 365 | v=spf1 include:_spf.google.com include:spf.protection.outlook.com ~all |
| Google Workspace plus a marketing tool | v=spf1 include:_spf.google.com include:sendgrid.net ~all |
| A domain that never sends email | v=spf1 -all |
Sequencers such as Instantly, Smartlead and lemlist send through your Google Workspace or Microsoft 365 account, so they need no include of their own.
SPF record for Google Workspace
The SPF record for Google Workspace is v=spf1 include:_spf.google.com ~all. Add it as a TXT record on @ at your DNS host; if an SPF record already exists, add include:_spf.google.com to it instead of creating a second one. It costs one DNS lookup. Run the SPF checker afterwards: the summary should say it authorises Google Workspace.
SPF record for Office 365
The SPF record for Office 365 (Microsoft 365) is v=spf1 include:spf.protection.outlook.com -all. Microsoft recommends -all, though ~all also works. Add it on @, merging with any existing record, then check SPF record status with the tool: it should name Microsoft 365 and stay at one DNS lookup.
What your SPF check results mean
| SPF record check result | What it means | Fix |
|---|---|---|
| No SPF record found | No TXT record starts with v=spf1. | Add one from the examples above. |
| More than one SPF record | Two TXT records start with v=spf1, often after a provider change. | Publish the merged record the tool shows; delete the others. |
| Over 10 DNS lookups | Too many includes; PermError for every message. | See the next section. |
| Include with no SPF record | A typo, or a service you no longer use. | Correct the include or remove it. |
| Provider is not authorised | Your MX points at Google or Microsoft but SPF does not include them. | Copy the corrected record the tool shows. |
| +all | Every server in the world passes SPF for your domain. | Change to ~all or -all. |
| Terms after all | Receivers stop at all, so later terms are ignored. | Move all to the end. |
| Record over 255 or 450 characters | Must be split; very long records strain DNS. | Remove unused includes. |
| Uses ptr | Deprecated and slow; some receivers ignore it. | Replace with ip4, ip6 or an include. |
SPF too many DNS lookups: the limit of 10
Every include, a, mx, exists, ptr and redirect makes the receiver do another SPF lookup, and so does every include inside those includes. SPF stops at 10. Go over and the record is broken for every email you send, not just mail from the extra service. That is why this SPF record checker counts through the whole tree and shows it.
To fix too many DNS lookups: remove includes for services you no longer use, replace a and mx with the ip4 addresses they stand for, or move a marketing tool onto its own subdomain with its own SPF record. SPF flattening works too, but needs updating whenever a provider changes its IPs. Cold email domains rarely hit the limit, because they send from one provider; company domains with a CRM, help desk and newsletter tool often do. One more reason to send cold email from separate domains.
SPF PermError and "SPF check failed"
"SPF check failed" in a message header has two causes. Either the sending server is not in the SPF record (fail or soft fail), or the record itself is broken (SPF PermError): two records, more than 10 lookups, more than two void lookups or a syntax error. Enter the domain and the sending IP from the Received header above, and the SPF test shows which one.
Why SPF matters for cold email
Gmail and Yahoo require SPF or DKIM from every sender, and SPF, DKIM and DMARC from bulk senders; Outlook.com applies the same rules to high-volume senders. DMARC passes only when SPF or DKIM aligns with the From domain, so a working SPF record is one of two ways to pass it. Check the other records with the DKIM checker and the DMARC checker, make sure replies reach you with the MX lookup, or test all four on the free email deliverability tools page. Check SPF record changes the same day you make them. The full setup is in the cold email deliverability checklist.
Or skip the DNS work: PureMail sets up SPF, DKIM, DMARC and MX on every domain, creates your Google Workspace or Microsoft 365 inboxes and connects them to your sequencer, in about four hours, from $2.90 an inbox.