SPF record checker

Look up the SPF record of a domain and see the problems that most often break it: more than one record, +all, no all mechanism, or too many DNS lookups.

What SPF is

SPF (Sender Policy Framework) is a TXT record that lists the servers allowed to send mail for your domain. A receiving server compares the connecting IP address with that list. The record starts with v=spf1, contains mechanisms such as include, ip4, a and mx, and ends with an all mechanism that says what to do with everyone else.

-all means reject mail from servers not listed, ~all means accept it but treat it as suspicious, ?all expresses no opinion, and +all allows anyone, which defeats the purpose.

What this check looks for

A domain may publish exactly one SPF record. Two records cause a permanent error at the receiver, and the usual cause is adding a second record for a new mail service instead of merging it into the first. The check also flags a record that ends in +all, has no all or redirect at all, or appears to need more than the ten DNS lookups the standard allows.

The lookup count is a count of the mechanisms in your own record. Nested includes inside other providers' records add to the real total, so a record that is close to ten here may already be over the limit.

What SPF cannot do

SPF checks the envelope sender, not the From address people see, and it breaks when mail is forwarded. On its own it does not stop spoofing of your visible address. That is what DMARC is for, together with DKIM. A valid SPF record also does not guarantee that your mail reaches the inbox.

FAQ

How do I check the SPF record of a domain?

Enter the domain above. From a terminal, dig TXT example.com shows all TXT records; the SPF record is the one that starts with v=spf1.

Can a domain have two SPF records?

No. More than one record starting with v=spf1 is an error and receivers treat SPF as failed. Merge the mechanisms into one record.

What is the difference between ~all and -all?

-all (fail) asks receivers to reject mail from unlisted servers. ~all (softfail) asks them to accept it but mark it as suspicious. With DMARC in place, both lead to the DMARC policy being applied.

What is the SPF 10 lookup limit?

Evaluating an SPF record may trigger at most ten DNS lookups, counting include, a, mx, exists, redirect and ptr, including those inside included records. Beyond that the result is a permanent error.

Is a valid SPF record enough to reach the inbox?

No. It removes one reason for rejection. Placement also depends on DKIM, DMARC, sender reputation and the content of the message.