SPF guide

SPF record syntax, with examples

Every part of an SPF record explained, with copy-ready examples for Google Workspace, Microsoft 365 and more.

The basic shape

An SPF record is one TXT record at the root of your domain (name @). It starts with v=spf1, lists who may send for you, and ends with a rule for everyone else. Inboxes read it left to right and stop at the first part that matches the sending server.

v=spf1 include:_spf.google.com ~all

Every part, explained

PartWhat it meansLookups
v=spf1Marks the record as SPF. Always first, only once.0
include:domainAllow everyone that domain’s SPF record allows. How you add a service.1 or more
aAllow the IP address your domain points to.1
mxAllow your inbox (MX) servers.1
ip4: / ip6:Allow a fixed address or range, such as ip4:203.0.113.0/24.0
exists:An advanced rule used by some large providers.1
ptrOutdated. Don’t use it.1
redirect=domainUse another domain’s SPF record instead of this one.1
allEveryone else. Always last.0

The prefixes

PrefixResultExample
+ (or nothing)Passinclude:_spf.google.com
~Soft fail: accept but treat as suspicious~all
-Fail: reject-all
?Neutral: no opinion?all

SPF record examples

Google Workspace only:

v=spf1 include:_spf.google.com ~all

Microsoft 365 only:

v=spf1 include:spf.protection.outlook.com ~all

Google Workspace, Mailchimp and your own server:

v=spf1 ip4:203.0.113.10 include:_spf.google.com include:servers.mcsv.net ~all

A domain that never sends email:

v=spf1 -all

The rules that break SPF

  • Only one SPF record per domain. Two records fail every check. See how to merge multiple SPF records.
  • No more than 10 DNS lookups, counting includes inside includes. See how to fix too many lookups.
  • One ending, at the end. Anything after all is ignored.
  • Long records over 255 characters must be split into quoted chunks; most DNS providers do this for you.

Build or check your record

Pick your services and get a correct record with every lookup counted, or check the one you have.