Google Workspace SPF, DKIM, and DMARC Setup Guide

Google Workspace email authentication requires three DNS TXT records on your custom domain: an SPF record containing v=spf1 include:_spf.google.com ~all at the root, a 2048-bit RSA DKIM key published at google._domainkey and activated inside Google Admin Console, and a DMARC policy at _dmarc starting at p=none with an aggregate reporting address. Inbound delivery pairs with the single MX record smtp.google.com at priority 1.

Google Workspace DNS Records Quick-Reference Table

Every custom Google Workspace domain needs one SPF record, one active DKIM TXT key, and one DMARC policy record in its authoritative DNS zone, alongside MX routing for incoming mail. Copy the exact host names and formats below into Cloudflare, Route 53, GoDaddy, Namecheap, or your domain registrar.

Google Workspace SPF, DKIM, DMARC, and MX DNS record specifications
Record Type Host / Name Value Recommended TTL
SPF TXT @ (root domain) v=spf1 include:_spf.google.com ~all 3600 (1 hour)
DKIM TXT google._domainkey v=DKIM1; k=rsa; p=MIIBIjANBgkq... (copied from Admin Console) 3600 (1 hour)
DMARC (start) TXT _dmarc v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com 3600 (1 hour)
MX (current) MX @ (root domain) smtp.google.com (Priority 1) 3600 (1 hour)

Some DNS panels expect your full domain appended to subdomain hosts (for example google._domainkey.yourdomain.com and _dmarc.yourdomain.com), whereas Cloudflare, Route 53, and Namecheap append the zone name automatically. Check your provider's existing records first so you do not accidentally create _dmarc.yourdomain.com.yourdomain.com.

Step 1: Publish the Google Workspace SPF Record

The Google Workspace SPF record authorizes Google's outbound mail servers to send email for your domain using a single TXT record at the zone apex (@).

# Google Workspace only:
v=spf1 include:_spf.google.com ~all

# Google Workspace + another sender (example: SendGrid):
v=spf1 include:_spf.google.com include:sendgrid.net ~all
  1. Check whether your root domain already has a TXT record starting with v=spf1. Never publish a second SPF record on the same hostname; edit the existing one instead.
  2. Add include:_spf.google.com before the trailing qualifier (~all). Use ~all (softfail) while rolling out DMARC so forwarding breaks are less likely to drop legitimate messages before DKIM is verified.
  3. Never copy Google's raw IP blocks manually into your SPF record. Live DNS queries against _spf.google.com return 4 IPv4 ranges and 6 IPv6 /56 ranges directly without nested includes, which consumes only 1 of the 10 DNS lookups permitted under the Sender Policy Framework specification (IETF RFC 7208), and keeps your authorization updated automatically if Google adds or rotates ranges.
  4. Confirm the live syntax, single-record status, and lookup count with the SPF record checker. If combining Google Workspace with multiple marketing or CRM platforms pushes your total above 10 lookups, consolidate or trim unused includes with the SPF flattener.

Step 2: Generate and Activate Google Workspace DKIM

Google Workspace signs outgoing messages with a domain-specific cryptographic DKIM key only after a super administrator generates the key in Admin Console, publishes its DNS TXT record, and clicks Start authentication.

  1. Sign in to admin.google.com with a super administrator account.
  2. Open Menu > Apps > Google Workspace > Gmail > Authenticate email.
  3. Choose your target domain in the Selected domain dropdown and click Generate new record.
  4. Select 2048-bit key length (recommended) and keep the default selector prefix google unless that selector is already taken on your domain. Only drop to 1024-bit if a legacy DNS provider cannot store TXT records longer than 255 characters.
  5. In your DNS dashboard, create a TXT record at host google._domainkey (or <prefix>._domainkey) and paste the entire v=DKIM1; k=rsa; p=... string from Admin Console. Modern hosts such as Cloudflare and Namecheap split 2048-bit values across 255-byte DNS chunks automatically; older panels may require enclosing two segments in quotes.
  6. Wait for the record to appear publicly, verify the published key length and syntax with the DKIM record checker using selector google, then return to Admin Console and click Start authentication. Google documents that status updates can take up to 48 hours to clear across global DNS caches.

When rotating a Google Workspace DKIM key later, generate the replacement under a new custom prefix (for example google2026) so the previous google._domainkey key remains published while in-flight messages are verified.

Step 3: Publish and Enforce Your Google Workspace DMARC Record

A DMARC policy at _dmarc.yourdomain.com tells receiving servers how to handle mail that fails aligned SPF and DKIM checks, and routes daily XML visibility reports back to your team under the active DMARC standard (IETF RFC 9989).

Three-stage Google Workspace DMARC rollout policies from monitoring to reject
Rollout stage DNS TXT value at _dmarc Typical duration Operational effect
Stage 1: Monitor v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com 2 to 4 weeks Delivers all mail while aggregate XML reports reveal every active sender and alignment failure.
Stage 2: Quarantine v=DMARC1; p=quarantine; pct=25; rua=mailto:dmarc@yourdomain.com 1 to 2 weeks per step Routes unauthenticated or unaligned mail to spam; ramp pct from 25 to 100 as reports stay clean.
Stage 3: Reject v=DMARC1; p=reject; rua=mailto:dmarc@yourdomain.com Ongoing production Blocks spoofed mail claiming your domain after every legitimate service passes aligned SPF or DKIM.

Google Workspace passes DMARC alignment in relaxed mode by default once custom DKIM signing is enabled (the DKIM d= domain matches your visible From header domain) and custom-domain mail uses your domain's return path for SPF. Validate your published policy tags with the DMARC record checker, follow the full DMARC enforcement roadmap before moving from p=none to p=reject, and review the Gmail and Yahoo bulk sender requirements if your domain sends 5,000 or more daily messages to personal Gmail or Yahoo inboxes.

How to Verify Google Workspace Authentication End to End

DNS publication confirms resolvers can read your records, while a live test message confirms Google Workspace is actually signing outbound headers and passing alignment at the recipient.

# Check SPF, DKIM (selector: google), DMARC, and MX from Linux / macOS:
dig +short TXT yourdomain.com | grep v=spf1
dig +short TXT google._domainkey.yourdomain.com
dig +short TXT _dmarc.yourdomain.com
dig +short MX yourdomain.com

# Windows PowerShell equivalents:
Resolve-DnsName yourdomain.com -Type TXT
Resolve-DnsName google._domainkey.yourdomain.com -Type TXT
Resolve-DnsName _dmarc.yourdomain.com -Type TXT
Resolve-DnsName yourdomain.com -Type MX
  1. Send a plain test email from a Google Workspace mailbox on your custom domain to an external Gmail or Outlook account.
  2. Open the received message in Gmail, click the three-dot menu, and choose Show original.
  3. Confirm the summary banner shows SPF: PASS, DKIM: PASS with domain yourdomain.com, and DMARC: PASS. If DKIM shows PASS with domain yourdomain-com.20230601.gappssmtp.com instead of your own domain, custom DKIM is not turned on yet and DKIM alignment will fail under DMARC.

Common Google Workspace SPF, DKIM, and DMARC Errors and Fixes

Most Google Workspace authentication failures trace back to duplicate SPF TXT entries, truncated 2048-bit DKIM values, or unactivated custom DKIM signing on secondary domains. Match the symptom below to its direct DNS or Admin Console fix; if recipients are bouncing messages with a Gmail rejection code, see the SMTP 550 5.7.26 error guide.

Common Google Workspace SPF, DKIM, and DMARC failures, causes, and fixes
Error or symptom Root cause Direct fix
Two separate v=spf1 TXT records exist on @ Receivers return SPF PermError and reject or demote messages because DNS only allows one SPF record per hostname. Merge every sender into one TXT record such as v=spf1 include:_spf.google.com include:sendgrid.net ~all and delete the duplicate entry.
SPF lookup count exceeds 10 Adding too many third-party marketing and CRM includes triggers SPF PermError even though include:_spf.google.com uses 1 lookup on its own. Remove retired ESP includes, switch dedicated tools to subdomains, or flatten static vendor ranges before saving.
Start authentication fails for 2048-bit DKIM Older DNS panels truncate TXT strings longer than 255 characters or fail to split the 2048-bit key into quoted chunks. Split the TXT value into two quoted strings under 255 characters each per your DNS host syntax, or generate a 1024-bit key only if your host cannot store 2048-bit TXT records.
Recipients see "via" or "sent on behalf of" The visible From header domain does not align with the authenticated SPF return path or DKIM signing d= domain. Verify DKIM signing is active for the exact custom domain in Google Admin Console and confirm messages are sent from your custom domain rather than gmail.com.
Secondary domain or domain alias fails DKIM Google Workspace does not automatically inherit DKIM keys across secondary domains or aliases. Select each secondary domain and alias individually in the Admin Console dropdown, generate its own key, publish its TXT record, and click Start authentication.
Mail bounces with SMTP 550 5.7.26 Gmail or another receiving server rejected unauthenticated mail because neither aligned SPF nor aligned DKIM passed. Verify the live SPF record, confirm selector google resolves and signs outbound headers, and publish at least a p=none DMARC record.

Next checks

Frequently asked questions

How many DNS lookups does include:_spf.google.com use?+

Live DNS inspection shows _spf.google.com currently publishes 4 IPv4 CIDR ranges and 6 IPv6 /56 ranges directly without nested includes, consuming 1 of the 10 allowed SPF DNS lookups. Google can update its netblocks at any time, so always reference include:_spf.google.com rather than copying raw IP addresses into your zone.

How long does Google Workspace SPF, DKIM, and DMARC activation take?+

SPF and DMARC take effect as soon as your DNS provider propagates the TXT records, typically within minutes up to your previous TTL. DKIM activates only after the google._domainkey TXT record propagates and you click Start authentication in Google Admin Console, which Google notes can take up to 48 hours to settle across all resolvers.

Should I pick a 2048-bit or 1024-bit DKIM key in Google Workspace?+

Choose 2048-bit RSA whenever your DNS host supports TXT values longer than 255 characters, which covers Cloudflare, Route 53, Google Cloud DNS, Namecheap, and most modern providers. Use 1024-bit only as a fallback when a legacy registrar rejects 2048-bit TXT strings even when split into quoted segments.

Do I need to add SPF or DKIM for every Google Workspace user?+

No, SPF, DKIM, and DMARC are published once per domain in DNS and cover every mailbox on that domain. If your Google Workspace tenant has multiple domains or domain aliases, configure SPF, DKIM, and DMARC separately for each sending domain.

Should I use smtp.google.com or the five legacy aspmx.l.google.com MX records?+

Google Workspace now uses a single MX record pointing to smtp.google.com at priority 1 for new setups. Existing domains already running the five legacy aspmx.l.google.com records continue receiving mail normally and do not break outbound SPF or DKIM authentication.

How do I add another email tool alongside Google Workspace without breaking SPF?+

Insert the third-party service include mechanism into your existing root v=spf1 record before ~all instead of creating a second SPF TXT record. Configure that service with its own DKIM selector, and verify the combined lookup total stays at or below 10.

Last verified: 2026-12-02