Guide
Set up SPF, DKIM and DMARC for Google Workspace
The MX, SPF, DKIM and DMARC records Google Workspace needs, and where to turn on DKIM in the Admin console.
Updated
To send and receive mail as your own domain with Google Workspace, your domain’s DNS needs four kinds of record: MX so mail reaches Google Workspace, SPF to say Google Workspace may send as you, DKIM so Google Workspace can sign your mail, and DMARC to tell receivers what to do with mail that fails. Google Workspace lists the records it wants under Admin console → Account → Domains → Manage domains.
The examples use example.com: put your own domain in its place. In the Name column, @ means the domain itself; some DNS hosts want that field left empty instead.
The records at a glance
| Type | Name | Value | Priority |
|---|---|---|---|
| MX | @ | smtp.google.com | 1 |
| TXT | @ | v=spf1 include:_spf.google.com ~all | |
| TXT | google._domainkey | v=DKIM1; k=rsa; p=…Shape only: copy yours from Google Workspace. | |
| TXT | _dmarc | v=DMARC1; p=none; rua=mailto:dmarc-reports@example.com |
1. Verify the domain
When you sign up, Google asks for a TXT record starting google-site-verification= to prove you own the domain. Leave it in place afterwards.
2. MX: receive mail at Google Workspace
Delete any MX records left from a previous provider (or from your domain registrar), then add these. Mixing old and new MX records sends some of your mail to the old place.
| Type | Name | Value | Priority |
|---|---|---|---|
| MX | @ | smtp.google.com | 1 |
Older setups use five records (ASPMX.L.GOOGLE.COM and four ALT servers). Those still work; you don’t need to change them.
3. SPF: allow Google Workspace to send
Add one TXT record at the domain itself:
v=spf1 include:_spf.google.com ~all A domain can have only one SPF record. If you already have one, add include:_spf.google.com to it instead of creating a second, and add the includes
of any other service that sends as you (a newsletter tool, a help desk). The SPF record generator builds the combined record and counts its
lookups.
4. DKIM: sign your mail
- Sign in to the Google Admin console (admin.google.com) as an administrator.
- Go to Apps → Google Workspace → Gmail → Authenticate email.
- Pick your domain, then click Generate new record. Keep the 2048-bit key length and the selector prefix “google”.
- Copy the TXT record name and value Google shows, and add them at your DNS host.
- Wait until the record is live (up to an hour, sometimes longer), then come back and click Start authentication.
The TXT record looks like this:
| Type | Name | Value |
|---|---|---|
| TXT | google._domainkey | v=DKIM1; k=rsa; p=…Shape only: copy yours from Google Workspace. |
A 2048-bit key is longer than 255 characters. Most DNS hosts split it for you; if yours refuses it, split the value into two quoted strings, or generate a 1024-bit key instead.
5. DMARC: decide what happens to forged mail
Add one TXT record named _dmarc:
v=DMARC1; p=none; rua=mailto:dmarc-reports@example.com p=none changes nothing about delivery: it asks receivers to send you reports, so
you can see what sends as your domain. Create the report mailbox first, or use an address you
already read. Once the reports show only mail you recognise passing, move to p=quarantine and then p=reject, as described in moving DMARC to p=reject.
6. Check it works
New records usually show up within minutes, but can take up to an hour or two (longer if you replaced records with a long TTL). Run the email domain health check: it recognises Google Workspace from your MX records and lists anything still missing, with the exact record to add. To see a record reach resolvers around the world, use the DNS propagation checker.
Things to watch with Google Workspace
- Gmail signs mail with a google.com key until you turn on your own DKIM. That passes DKIM but not DMARC alignment, so turn yours on even if mail already arrives.
- If other services send as your domain too (a newsletter tool, a help desk), their includes go in the same SPF record. One domain has exactly one SPF record.
Where to add the records
Step-by-step instructions for the record editor at common DNS hosts:
Not sure who hosts your DNS? It’s usually where you bought the domain, unless you moved its name servers. The WHOIS lookup shows the name servers, and the health check names the host for you.
Related tools
All toolsEmail Domain Health Check
SPF, DKIM, DMARC and MX checked together, with a score and a list of fixes.
SPF Record Generator
Pick the services that send your email and get a ready-to-paste SPF record, lookups counted.
DKIM Record Checker
Find DKIM keys under common selectors, or check your own, with key size and problems.
DMARC Record Generator
Choose a policy and where reports go, and get a DMARC record with a safe path to p=reject.
More guides
- Set up SPF, DKIM and DMARC for Microsoft 365 The MX, SPF, DKIM and DMARC records Microsoft 365 needs, and how to turn on DKIM in the Defender portal.
- Set up SPF, DKIM and DMARC for Zoho Mail The MX, SPF, DKIM and DMARC records Zoho Mail needs, for every Zoho region, and where to add a DKIM key.
- Set up SPF, DKIM and DMARC for Proton Mail The verification, MX, SPF, DKIM and DMARC records Proton Mail needs for a custom domain, and where to copy them.