Google Workspace SPF, DKIM & DMARC Setup Guide

Exact DNS TXT records required to authenticate Google Workspace (Gmail for Business) custom domains — including the hidden 4-lookup SPF weight of _spf.google.com.

SPF: 4 LookupsDKIM: 2048-bit RSASelector: google._domainkey

Copy-Ready DNS Records & Configuration

Host / NameTypeValueTTLPurpose
@ TXT v=spf1 include:_spf.google.com ~all 3600 Root SPF record (expands to 4 DNS lookups via _netblocks 1-3)
google._domainkey TXT v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A... 3600 Generated in Google Admin Console -> Apps -> Gmail -> Authenticate email
_dmarc TXT v=DMARC1; p=quarantine; adkim=r; aspf=r; rua=mailto:dmarc@yourdomain.com; 3600 Start with p=none for 14 days, then advance to quarantine/reject

Interactive SPF 10-DNS-Lookup Limit Checker

MechanismTypeDirectEst. TotalNotes

Step-by-Step Deployment Checklist

  1. Publish the single root SPF TXT record (`v=spf1 include:_spf.google.com ~all`). Never create two separate `v=spf1` TXT records on the same host.
  2. In Google Admin Console, navigate to Apps -> Google Workspace -> Gmail -> Authenticate email, generate a 2048-bit key (default selector `google`), and publish `google._domainkey`.
  3. Wait 15–60 minutes for DNS propagation, click 'Start authentication' in Google Admin, and verify `dkim=pass` in Gmail's 'Show original' header.
  4. Add `_dmarc` TXT record with `p=none` and a valid `rua=` reporting address before stepping up to `p=quarantine` or `p=reject`.

Common Pitfalls to Avoid

JetBrains Plugin + Gumroad

Never Commit SMTP Passwords, DKIM Private Keys, or API Secrets to Git

EnvGuard for JetBrains IDEs scans .env, YAML, and DNS config files locally before commit — paired with our DevOps & AI Automation Kits on Gumroad.

Frequently Asked Questions

How many DNS lookups does Google Workspace SPF use?

`include:_spf.google.com` uses 4 DNS lookups total (1 for `_spf.google.com` plus 3 nested `_netblocks` includes).

Should I use 1024-bit or 2048-bit DKIM in Google Workspace?

Always choose 2048-bit RSA unless your legacy DNS host strictly cannot handle split TXT strings over 255 bytes.

Should Google Workspace SPF end with ~all or -all?

Google recommends `~all` (SoftFail) paired with DMARC enforcement (`p=quarantine` or `p=reject`) to avoid breaking legitimate mailing-list forwarding.

Related DNS & Email Auth Guides