SPF check: validate your SPF record

Enter a domain and see its SPF record taken apart: every include followed, the DNS lookups counted, and the mistakes that make receivers ignore it. Add an IP address to test whether it may send mail for the domain.

What the SPF check covers

The record itself
Whether the domain has exactly one SPF record and every term in it is valid.
The 10-lookup limit
How many DNS lookups evaluating the record needs. Above ten, receivers give up and SPF fails for all mail.
Includes and redirects
The records your record pulls in from mail providers, shown as a tree, and whether each of them exists.
The policy
What happens to mail from servers you did not list: rejected (-all), marked suspicious (~all) or let through.
Authorized senders
Every address and network that ends up allowed to send mail for the domain.
A single sender
Whether one specific IP address would pass, and which term decides it.

How to set up an SPF record

An SPF record is a single TXT record at the domain itself. Setting it up takes four steps; the order matters, because a record that leaves out a service you send with makes that service's mail fail the check.

  1. List everything that sends mail as your domainBesides the mailboxes at your hosting or mail provider, that is the website (contact forms, webshop orders), the newsletter service, the invoicing and CRM systems. Each of them has to be in the record.
  2. Collect the term for each senderEvery mail provider publishes what to add, usually an include: include:_spf.google.com for Google Workspace, include:spf.protection.outlook.com for Microsoft 365. For a server of your own, give its address: ip4:192.0.2.10. mx allows the servers that receive the domain's mail, a the server the domain itself points to.
  3. Put them into one recordStart with v=spf1, list the terms, and end with the policy: v=spf1 mx include:_spf.google.com ~all. Publish it as a TXT record at the domain name itself (many DNS editors show that as @). A domain may have only one SPF record: if there is one already, extend it instead of adding a second.
  4. Check it, then tighten itRun the check above: it shows whether the record is valid and how many of the ten DNS lookups it uses. Enter the address of one of your sending servers to see that it passes. Start with ~all, and once the DMARC reports show that all your mail passes, you can move to -all.

Frequently asked questions

What is an SPF record?

A TXT record in the domain's DNS that lists which servers may send mail using the domain as sender. Receiving servers compare the sending server's address with that list.

Why does SPF fail although my record looks right?

The most common cause is the limit of ten DNS lookups: every include, a, mx and redirect counts, including those inside the records you include. Above ten the whole record is ignored. Having two SPF records has the same effect.

Should the record end with "-all" or "~all"?

Both tell receivers that unlisted servers are not allowed. "-all" asks them to reject such mail, "~all" to accept it as suspicious. With a DMARC policy in place the two are equally effective, and "~all" is the safer choice while you are still finding all your sending services.

Is SPF enough on its own?

No. SPF checks the envelope sender, which the recipient never sees. Only together with DKIM and a DMARC policy does it protect the visible From address.

What should a domain that sends no mail publish?

v=spf1 -all: it tells receivers that no server may send mail as the domain, which stops others forging it.

Related tools

DKIM Check
Look up a DKIM key by selector and check the key's length and the record's syntax. Without a selector, the common ones are tried.
DMARC Check
Is the domain protected against forged mail? DMARC policy, alignment, report addresses and the common mistakes.
IP Address Info
Which name an IP address points back to, whether the two directions agree, and whose network it is in.