Look up and validate the SPF record of any domain. Count DNS lookups, follow every include, check the all mechanism and get clear fixes for SPF errors.
Every check reads the domain's public DNS records for MX, SPF and DMARC. DKIM needs a selector from a real email, so check it with the email header analyzer.
An SPF (Sender Policy Framework) record is a TXT record in your DNS that lists every server allowed to send email for your domain. When an email arrives, the receiving server checks the sending server against this list. A record for a domain that uses Google Workspace can be as simple as v=spf1 include:_spf.google.com ~all.
Allow a single IP address or a range, such as ip4:203.0.113.0/24. They do not use a DNS lookup.
Allow the servers of another service, such as include:_spf.google.com. Each include uses at least one lookup.
Allow the IP of the domain's A record or of its mail servers. Each uses a DNS lookup.
Matches every other server and goes at the end: -all rejects them, ~all soft fails them and ?all is neutral.
Each service that sends email for you gives you an include to add. Always copy the exact value from your provider's setup page, because some use different values per region.
| Service | SPF include |
|---|---|
| Google Workspace | include:_spf.google.com |
| Microsoft 365 | include:spf.protection.outlook.com |
| Zoho Mail | include:zohomail.com |
| SendGrid | include:sendgrid.net |
| Mailgun | include:mailgun.org |
| Amazon SES (custom MAIL FROM) | include:amazonses.com |
To use several services, put all the includes in one record. For example, a domain that uses Google Workspace for staff email and SendGrid for website emails would publish:
v=spf1 include:_spf.google.com include:sendgrid.net ~all
| Result | What it means |
|---|---|
| pass | The sending server is listed in the SPF record. |
| fail | The server is not listed and the record ends with -all. |
| softfail | The server is not listed and the record ends with ~all. Usually treated as suspicious, not rejected. |
| neutral | The record ends with ?all, so it makes no claim either way. |
| none | The domain has no SPF record. |
| permerror | The record is broken, for example two records or more than 10 lookups. |
| temperror | A temporary DNS problem. The receiver may try again later. |
SPF works best with DMARC. Check your DMARC record, and test your email content with the spam checker.