If you use Google Workspace for email, Google tells you to add this line to your domain's DNS:
v=spf1 include:_spf.google.com ~allIt's short, but each of its three parts does a different job, and small changes to it (a missing underscore, a second copy of the record, the wrong ending) can quietly break email for your whole domain. This guide goes through it piece by piece.
What the record is for
This is an SPF record. SPF (Sender Policy Framework) is a list, published in your DNS, of the servers allowed to send email for your domain. When a mail server receives a message, it looks up that list and checks whether the server that delivered the message is on it.
This particular record says one thing: "Google's mail servers may send for this domain, and anything else is suspicious." It's the record Google gives to organizations that send email only through Google Workspace.
The three parts
| Part | What it does |
|---|---|
v=spf1 | Marks the TXT record as an SPF record (version 1, the only version). It must come first, written exactly like this. |
include:_spf.google.com | Authorizes every server listed in Google's own SPF record, published at _spf.google.com. |
~all | Tells receivers what to do with mail from any server not listed: treat it as a "soft fail". |
The parts are separated by single spaces. The receiver reads them left to right and stops at the first one that matches the sending server.
v=spf1
Your domain can have many TXT records: site verification codes, other services' settings and so on. A receiver finds the SPF record by looking for the one that starts with v=spf1. If that text is missing or misspelled (v=spf, v-spf1, or a stray character in front of it), receivers don't see an SPF record at all.
include:_spf.google.com
Google sends mail from a large and changing set of IP addresses. Instead of listing them in your record, you point to Google's list, and Google keeps it up to date. When a receiver reaches this part, it looks up the SPF record at _spf.google.com and checks the sending server against that. If the server is on Google's list, your SPF check passes.
Two things about include: are easy to miss:
- It costs DNS lookups. SPF allows at most 10 DNS lookups per check, and every
include:uses at least one, plus any includes inside the record it points to. As of November 2026, Google's include costs just one:_spf.google.comlists Google's addresses directly, with no further includes. It used to point to several more records, so older articles say it costs about four. The Rigcheck checker counts your record's current total. - The underscore matters.
_spf.google.comandspf.google.comare different names. Copy the include exactly as shown.
~all
all matches every server, so it only comes into play when nothing before it matched. The symbol in front decides the result:
| Ending | Result | What receivers usually do |
|---|---|---|
~all | Soft fail | Accept the message but treat it as suspicious. |
-all | Fail | May reject the message. |
?all | Neutral | No opinion either way, so it gives little protection. |
+all | Pass | Lets any server in the world send as you. Never use it. |
Google recommends ~all, and warns that -all can send more of your mail to spam if the record is set up wrong. Once DMARC is in place, DMARC is what decides what happens to mail that fails, so ~all doesn't leave you less protected.
Where the record goes
@TXTv=spf1 include:_spf.google.com ~allAdd it at your DNS host (wherever your domain's DNS records are managed), as a TXT record at the root of your domain. Most DNS hosts write the root as @; some want the field left blank or your bare domain name. It doesn't go in the Google Admin console. Google says it can take up to 48 hours for SPF to start working.
Using other email services too
The record above only covers mail sent through Gmail. If a newsletter tool, help desk, CRM or your website also sends as your domain, each may need its own include:. Add them to the same record, before ~all:
@TXTThat example adds a website server that sends its own mail. Each service's setup page lists its own include. Never create a second record that starts with v=spf1: two SPF records make SPF fail for all your mail. Multiple SPF records shows how to merge them if you already have two. Every include you add uses part of the 10-lookup budget, so keep an eye on the count; SPF too many DNS lookups covers what to do if you go over.
What this record doesn't do
- It doesn't check the From address people see. SPF checks the hidden Return-Path (bounce) domain. For mail sent through Gmail, that's your domain, so it works. For other services, it's often the service's own domain unless you set up a custom one.
- It doesn't tell Google customers apart. The include authorizes Google's shared mail servers, which send for every Google Workspace customer. SPF says which servers may send, not which customer is sending. That's why DKIM matters: it signs your mail with a key only your domain has. DKIM setup for Google Workspace walks through it.
- It doesn't set a policy. What receivers do with mail that fails is up to your DMARC record. DMARC setup for Google Workspace covers that.
Questions people ask
Do I need this if I use a personal @gmail.com address?
No. This record is for your own domain on Google Workspace. Google publishes SPF for gmail.com itself.
Should I copy Google's IP addresses into my record instead?
No. Google changes its sending addresses, and a copied list goes out of date without warning. Keep the include: and let Google maintain the list.
Rigcheck says Google is covered, but SPF still fails in my headers. Why?
Check which service sent that message and what its Return-Path domain was. A message sent through another tool is checked against that tool's servers, not Google's. Also check for a second SPF record or a lookup count over 10, which both make SPF fail for every message.