SPF: authorize your senders
Last updated: 2026-11-16
Google requirement
What it is #
SPF (Sender Policy Framework) is a TXT record on your domain that lists which mail servers are allowed to send email as you@yourdomain.com. Receiving servers check it and treat mail from unlisted servers as suspicious.
Why it matters #
Gmail requires SPF or DKIM on every message, and bulk senders (5,000+ messages a day to Gmail) need SPF, DKIM and DMARC. Google also recommends authenticating the domain your public website runs on, even if you only send from a subdomain. Without SPF, your cold emails and even your password-reset emails are more likely to land in spam or be rejected.
How we check it #
We look up the TXT records on your root domain over DNS-over-HTTPS and pass this check if one of them starts with v=spf1. If you scan a subdomain such as docs.yourdomain.com, we check the domain it belongs to, because that's where your email is sent from. If the DNS lookup itself fails, the check shows not measured, not failed.
We don't yet evaluate what's inside the record (for example, a +all or a missing include). That's on you — see the tips below.
How to fix #
- List every service that sends email as your domain. Mailbox provider (Google Workspace, Microsoft 365), plus anything that sends as
@yourdomain.com: help desk, CRM, newsletter tool, transactional email. - Build one record. Start from your mailbox provider and add each service's include: Add others inside the same record, before
~all, for examplev=spf1 include:_spf.google.com ~all
v=spf1 include:_spf.google.com include:sendgrid.net ~all.
- Publish it as a TXT record on the root (
@oryourdomain.com).
Name: yourdomain.com Type: TXT TTL: 300
Value: "v=spf1 include:_spf.google.com ~all"
⚠ Route 53 keeps ONE TXT record set per name. If you already have a TXT
record at the root (e.g. google-site-verification), EDIT that record set
and add SPF as another value — don't create a second set or overwrite it.DNS → Add record → Type: TXT → Name: @
Content: v=spf1 include:_spf.google.com ~all
(Cloudflare adds the quotes for you. Proxy status doesn't apply to TXT.)DNS → Add → TXT → Host: @
Value: v=spf1 include:_spf.google.com ~all
TTL: 1 hour (or the default)Verify it yourself #
dig +short TXT yourdomain.com | grep spf1Or use Google's free Check MX tool.
Tips #
- One SPF record per domain. Two
v=spf1records is an error, and receivers may ignore both. Merge them into one. - Keep it under 10 DNS lookups. Every
include:,a,mxandredirectcounts toward a hard limit of 10. Too many includes breaks SPF for all your mail. ~all(soft fail) is the safe start. Move to-allonly when you're sure every legitimate sender is listed.- Sending from a subdomain? A service that sends from
mail.yourdomain.comneeds SPF on that name. We use Resend onmail.gtmrun.co(SPF onsend.mail.gtmrun.co) and Google Workspace on the root, so they're separate records. - What we learned fixing gtmrun.co: our root had two
google-site-verificationTXT values and no SPF. A plain "upsert SPF" would have replaced the set and silently deleted both verification tokens. We merged instead.
Sources #
- Google: Email sender guidelines
- Google Workspace: Set up SPF
- RFC 7208 — Sender Policy Framework