Adding it
- Open your DNS provider (where your domain's records live, not necessarily where you bought it).
- Look for an existing TXT record that starts with
v=spf1. If there is one, edit it. Don't add a second one. - Add a TXT record on
@(some providers want the bare domain, or leave the host empty) with the value above. - Wait for it to show up. Most providers take minutes; some take a few hours. Then check it below.
Other tools send email too?
Most companies have more than one sender: a newsletter tool, a helpdesk, an invoicing app. Each one gets its own include: in the same record, before the ending. For example, with Mailgun as well:
v=spf1 include:_spf.google.com include:mailgun.org ~all
Your sending tool's setup page names its include. Some tools (Mailchimp, for one) send from their own domain and don't need to be in your SPF at all; they rely on DKIM instead.
The mistakes I see most
- Two SPF records. One from the Google setup, one added later for another tool. Two
v=spf1records are a permanent error, and receivers then ignore SPF entirely. Merge them into one. - Old Google values. Records with
include:aspmx.googlemail.comorinclude:google.comcome from old guides. Use_spf.google.com. - Too many lookups.
_spf.google.comcosts one of your ten DNS lookups, but other tools' includes often contain includes of their own. Add a few and it's easy to pass ten. See fixing "too many DNS lookups". - Stopping at SPF. SPF alone doesn't get you into Gmail's inbox. Turn on DKIM for Google Workspace and publish a DMARC record too.
~all or -all?
Google's own instructions use ~all (soft fail), and that's a safe start. Once DMARC is in place and its reports show nothing legitimate failing, -all is stricter, but in practice DMARC decides what happens to failing mail, not the SPF ending.