Free tool

SPF checker

Who can send email with your domain, and whether you go over the ten lookups.

Try

Reference

How it works and how to read it

SPF says which servers can send email with your domain. If it fails, the recipient can't tell it's you and treats the message as suspicious.

The record

A single line, in a TXT record on the domain

It starts with v=spf1 and lists who sends on your behalf: your servers, your email provider, your newsletter platform. If the domain publishes two SPF records, both stop being valid.

Anatomy of an SPF record

example

v=spf1

version, always first

ip4:203.0.113.10

your own server

include:_spf.google.com

Google Workspace

include:servers.mcsv.net

Mailchimp

-all

nobody else

The limit

Ten DNS lookups, not one more

Each include, a, mx or redirect costs one lookup, and the ones inside each include count too. On the eleventh the SPF returns an error and your email loses authentication, even if the record is written correctly.

Lookups used

example

include:_spf.google.com

brings three more inside

4

include:spf.protection.outlook.com

Microsoft 365

2

include:servers.mcsv.net

Mailchimp

1

mx

your incoming servers

1

ip4:203.0.113.10

an IP doesn't look anything up

0
Total 8 / 10

The ending

What happens to anyone not on the list

The last term decides what to do with a server you haven't named. With DMARC published, ~all is enough; -all is stricter. +all lets anyone send on your behalf: it's worse than having no SPF.

The all term

-all

reject: not ours

~all

accept, but as suspicious

?all

no opinion, doesn't protect

+all

anyone can send on your behalf

FAQ

What is the SPF record?

It's a TXT record on the domain that lists the servers authorised to send email with it. When a message arrives, the receiving server looks at which IP it comes from and checks whether it's on that list. If it isn't, SPF fails and the message loses credibility: it may go to spam or be rejected, depending on what your DMARC says.

Why is there a ten-lookup limit and how do I get under it?

The standard (RFC 7208) limits the DNS lookups an SPF evaluation can cost to ten, so nobody can use email as an attack amplifier. include, a, mx, ptr, exists and redirect count, including those inside each include. To reduce them: remove providers you no longer use, replace a and mx with the IP using ip4 when it's fixed, and send newsletters from a subdomain with its own SPF. Flattening the record (replacing the includes with their IPs) works until the provider changes IPs without warning.

Should I use -all or ~all?

If you already have DMARC, ~all is enough: DMARC decides what to do with a failure, and that way you don't lose legitimate email if one day you send from a service you forgot to add. -all makes sense when you know for certain who sends on your behalf. What you should never use is +all, which authorises anyone, or ?all, which protects nothing.

Can I have two SPF records?

No. If the domain publishes two TXT records starting with v=spf1, the result is a permanent error and neither is valid. It's a very common mistake when adding a new service: instead of creating another record, add its include to the one you already have.

If my SPF is correct, will I stop landing in spam?

It helps, but it isn't enough. Since February 2024 Gmail and Yahoo require SPF or DKIM from anyone sending to them, and SPF, DKIM and DMARC from anyone sending more than 5,000 messages a day. They also look at the IP's reputation, the content and how recipients react. To see it all together, send a message to our email test.