How to create an SPF record, step by step
Updated November 27, 2026
An SPF record is a list of the services allowed to send email for your domain. Email providers check it when your email arrives: if the email came from a service on your list, it passes SPF. Without the record, providers have no way to tell your real email from someone pretending to be you.
SPF is one of the three records Gmail, Yahoo and Outlook look for, along with DKIM and DMARC. See Google, Yahoo and Microsoft sender requirements.
Step 1: List everything that sends email as you
Think of every service that sends email with your domain in the From address, for example
you@yourbusiness.com or invoices@yourbusiness.com:
- Your email provider (Google Workspace, Microsoft 365 and so on)
- Your email marketing tool (such as Mailchimp or Constant Contact)
- Your online store, booking system, invoicing or accounting app
- Your website, if its contact form or shop sends email
Each service's help pages explain what to add to SPF, usually an include: entry. Search the
service's help for "SPF".
Step 2: Build the record
An SPF record has three parts: v=spf1 at the start, one entry for each service, and an ending.
If you use only Google Workspace, Google's own example is:
v=spf1 include:_spf.google.com ~all
If you use only Microsoft 365, Microsoft's example is:
v=spf1 include:spf.protection.outlook.com -all
If you also use other services, add each one's entry before the ending, all on one line. For example, Google Workspace plus Mailchimp:
v=spf1 include:_spf.google.com include:servers.mcsv.net ~all
Which ending?
~all("soft fail"): email from anything not on your list is treated as suspicious. A safe choice while you're still finding all your services.-all("fail"): email from anything not on your list is not allowed. Stricter.
Always end with one of these. A record with no ending gives unlisted senders a "neutral" result, which the SPF
standard says to treat the same as having no SPF record at all. Never use +all or
?all; see Risky SPF settings.
Step 3: Add it to your DNS
- Sign in wherever your domain's DNS is managed (often your domain registrar, or a service like Cloudflare).
- Check you don't already have one: look for a TXT record on your main domain starting with
v=spf1. If there is one, edit it instead of adding another. Two SPF records break SPF; see Multiple SPF records. - Add a TXT record. Name / host:
@(or leave it blank, depending on your DNS provider). Value: your SPF record. - Save, wait a few minutes, then run the free check to confirm it's found and correct.
Keep it under 10 lookups
SPF allows at most 10 DNS lookups, and each include: uses at least one. Most small businesses are
well under, but a long list of services can go over. The free check counts them for you. See
SPF: too many DNS lookups.
A domain that never sends email
If you own a domain you don't send email from (an old name, or one that only points to your website), publish this so it can't pass SPF for anyone:
v=spf1 -all
SPF alone isn't enough
SPF checks a hidden "return address" on each email, which many services set to their own domain, not yours. To fully protect your domain, also set up DKIM and DMARC. DMARC's reports then show every service sending as your domain, including any you forgot.
Check your domain for free
Our free check reads your domain's SPF, DKIM and DMARC records and tells you in plain English what's wrong and how to fix it. No account needed, and we don't save what you check.