How to set up an SPF record
SPF is a DNS record that lists the servers allowed to send email for your domain. Receiving mail servers look it up and treat messages from anywhere else as suspicious. Without it, anyone can send email that claims to come from you, and your real mail is more likely to land in spam.
Updated 2026-10-23
Why it matters
- It makes spoofing your domain harder, which protects your customers from phishing that looks like you.
- Mailbox providers such as Gmail and Microsoft favour mail from domains that publish SPF, together with DKIM and DMARC.
How to fix it
- Add one TXT record that lists who may send mail for your domain.
- The include: part depends on your mail provider. Google Workspace is shown; Microsoft 365 uses include:spf.protection.outlook.com, and each sending service (Mailchimp, SendGrid, SES...) has its own include.
- End it with ~all (soft fail) or -all (reject) once you are sure the list is complete.
After you deploy, re-check the site. A CDN or the browser cache can keep serving the old headers for a few minutes.
example.com. TXT "v=spf1 include:_spf.google.com ~all"
Common mistakes
- Having two SPF records. A domain may have only one; with two, receivers ignore both. Merge them into one record.
- Ending in +all or ?all, which allow everyone. Use ~all (soft fail) or -all (reject).
- Forgetting a sender: your newsletter tool, support desk or invoicing app. Each needs its include: entry or its mail will fail.
- Going over 10 DNS lookups. Each include: counts, and past 10 the whole record fails. Remove services you no longer use.
Check that it worked
Run your domain through the free spf and dmarc checker. It takes a few seconds, needs no account, and shows anything still missing.
Open the spf and dmarc checkerQuestions
- ~all or -all?
- Start with ~all while you confirm every sender is listed, then move to -all when you are sure. Combined with DMARC, either gives receivers a clear signal.
- Is SPF enough?
- No. SPF checks the hidden envelope sender. DMARC ties it to the From address people see, and DKIM signs the message. Set up SPF, then DMARC.
- My domain doesn't send email. Do I still need it?
- Yes, a record of v=spf1 -all says no server may send as your domain, which stops it being used for spoofing.
Related guides
Don't want to check by hand? Upzy watches your site around the clock and tells you when a header, certificate or email record slips. Start free.