Google Workspace
Google DKIM: how to set up DKIM in Google Workspace
Set up Google DKIM: generate the key in the Admin console, publish the google._domainkey TXT record, then turn on signing and test it.
Before you start
To set up Google DKIM, generate a key in the Google Admin console, publish it as a TXT record at your DNS host, then click Start authentication. DKIM (DomainKeys Identified Mail) signs each outgoing message so receivers can check it against the public key in your DNS.
You need a super administrator sign-in with the Gmail Settings administrator privilege, plus access to your domain's DNS. Wait 24 to 72 hours after turning on Gmail, or you might get an error that the DKIM record was not created.
If your domain provider is Squarespace, the key is added to your DNS automatically, so skip to turning on signing. If you send through an outbound gateway, confirm it does not change messages, because an added footer can make DKIM fail.
DKIM on G Suite
Google rebranded G Suite as Google Workspace, so these steps also cover accounts that started on G Suite.
Steps
Generate the key in the Admin console
- Go to Menu > Apps > Google Workspace > Gmail and click Authenticate email.
- In the Selected domain menu, choose the domain.
- Click Generate New Record.
- Choose 2048 bits if your DNS host supports it, or 1024 if it does not.
- Keep the default prefix selector
google(the label for this key in DNS) unless your domain already has a DKIM key with that prefix. - Click Generate, then copy the DNS Host name and the TXT record value.
Do not click Start authentication yet. A signature fails when receivers cannot find its public key in DNS.
Publish the Google Workspace DKIM record
-
At your domain host, open the page for DNS TXT records.
-
Create a TXT record. In the host field, enter the DNS Host name, which by default is:
google._domainkey -
In the value field, paste the TXT record value. It has the form
v=DKIM1; k=rsa; p=key, wherekeyis your public key. -
Save the record.
Repeat for each domain. Each one needs its own key from the Admin console.
Turn on signing
- Look up the record with the DKIM checker, using your domain and the selector
google. If the key is not visible yet, wait. Google says DKIM can take up to 48 hours to start working. - Return to Authenticate email and choose the domain.
- Click Start authentication.
If your DMARC policy is already p=quarantine or p=reject, check the key before step 3. A message that fails DKIM and has no aligned SPF pass fails DMARC, and the receiver may apply that policy.
Confirm it worked
- At the top of the Authenticate email page, the status should say Authenticating email with DKIM.
- Send a message to someone on Gmail or Google Workspace. A message to yourself cannot confirm that DKIM is on.
- In that person's Gmail, next to Reply, click More > Show original.
- Find
Authentication-Results. The DKIM result should say something likeDKIM=passorDKIM=OK. If there is no DKIM line, your messages are not being signed. - In
DKIM-Signature,s=shows your selector andd=should show your domain. DMARC counts a DKIM pass only when thed=domain aligns with the domain in theFrom:header.
Next, set up SPF on Google Workspace. Google says to allow 48 hours after setting up SPF or DKIM before setting up DMARC on Google Workspace.
Common problems
- The status says
Not authenticating. Your setup is unfinished. Open Authenticate email and click Start authentication. - The page keeps showing
You must update the DNS records for this domain.It can stay for up to 48 hours. If you added the key correctly, ignore it. - Your host rejects or cuts off the key. A 2048-bit key cannot go in one string with a 255-character limit. Split it into several quoted strings entered one after another, or use a 1024-bit key. Receivers join the strings with no space between them. Compare the published value with the Admin console using Google Admin Toolbox Dig.
body hash did not verify. The message changed in transit, for example at a gateway that adds a footer. See how to fix this DKIM error.- More than five DKIM signatures. Gmail checks only the first 5. If the one that authenticates comes later, the message fails DKIM and might fail DMARC.
- Removing a new record. Click Stop authentication first. Google recommends leaving the TXT record in place. If you must remove a new one, wait at least 4 days after adding it, because messages signed with DKIM will not pass without the key.