How to set up DKIM for Google Workspace and Microsoft 365
Updated November 27, 2026
DKIM adds a digital signature to every email you send. The receiving provider (Gmail, Outlook, Yahoo and so on) checks the signature against a public key published in your domain's DNS. If it matches, they know the email really came from your business and wasn't changed on the way.
Your email provider creates the signature for you. Your job is to turn DKIM on in its admin settings and add the DNS record it gives you. Below are the steps for the two most common providers for small businesses: Google Workspace and Microsoft 365.
Why it matters
- DMARC needs it. DMARC passes when SPF or DKIM passes for your own domain. SPF often breaks when email is forwarded; DKIM usually survives. See What is DMARC?
- Google and Yahoo require it for bulk senders, and both ask every sender for SPF or DKIM. See Google, Yahoo and Microsoft sender requirements.
- It has to be your own domain. For DMARC, the signature must be for the domain in your From address. Until you set up DKIM, some services sign with their own domain, or don't sign at all. Either way, it doesn't help your DMARC.
Google Workspace
You need to be a Google Workspace super administrator (or have the Gmail settings admin privilege). Google says that if you just started using Gmail, you may have to wait 24 to 72 hours before you can create the key.
- Sign in to the Google Admin console at
admin.google.com. - Go to Menu > Apps > Google Workspace > Gmail and click Authenticate email.
- Under Selected domain, pick your domain, then click Generate New Record.
- Choose a key length of 2048 (Google recommends it if your DNS provider supports it, and
nearly all do). Leave the prefix as
googleunless you already use that name. Click Generate. - Google shows a host name and a TXT value. Don't click "Start authentication" yet.
- In a new tab, sign in wherever your domain's DNS is managed (often your domain registrar, or a service like
Cloudflare) and add a TXT record:
- Name / host:
google._domainkey - Value: the text Google gave you. It starts with
v=DKIM1; k=rsa; p=followed by a long key.
google._domainkey.yourbusiness.com) and others add your domain automatically. If the record ends up asgoogle._domainkey.yourbusiness.com.yourbusiness.com, remove the extra domain. - Name / host:
- Back in the Admin console, on the same Authenticate email page, click Start authentication. The status should change to "Authenticating email with DKIM".
Google says it can take up to 48 hours for DKIM to start working, and during that time the Admin console may say you must update your DNS records. To test it, send an email to someone on Gmail (not to yourself) and ask them to check that the message details show DKIM passed.
Microsoft 365
You need to be an admin in Microsoft 365, and your domain must already be added there. Microsoft says it doesn't sign email from your own domain with DKIM until you turn it on.
- Go to the Microsoft Defender portal's email authentication page:
security.microsoft.com/authentication. (The menu path is Email & collaboration > Policies & rules > Threat policies > Email authentication settings.) - Open the DKIM tab and click your domain (not the one ending in
onmicrosoft.com). - Switch the toggle to Enabled. You'll see a "Client error" message. That's expected: it means the DNS records aren't there yet.
- In the domain's details, under Publish CNAMEs, copy the two values Microsoft shows.
- Where your DNS is managed, add two CNAME records:
- Name
selector1._domainkey, pointing to the first value Microsoft gave you - Name
selector2._domainkey, pointing to the second value
- Name
- Wait a few minutes, go back to the domain's details on the DKIM tab, and turn on Sign messages for this domain with DKIM signatures. When it works, the status shows "Signing DKIM signatures for this domain".
Microsoft creates 1024-bit keys by default. That meets Google's and Yahoo's minimum, but 2048-bit keys are
stronger. An admin can switch to 2048 bits the next time the keys are rotated, using Microsoft's PowerShell
command Rotate-DkimSigningConfig with -KeySize 2048. The new key takes about four
days to take effect.
Other email services
Every service that sends email as your domain needs its own DKIM setup: your email marketing tool (such as Mailchimp or Constant Contact), online store, booking system, invoicing app and so on. Look in each service's settings for "domain authentication", "DKIM" or "verify your domain". Each one gives you its own records to add, usually two or three CNAME or TXT records.
Check that it worked
The free check looks for DKIM under the names most providers
use, including google, selector1 and selector2. With an account,
SpoofResist also shows from your DMARC reports whether each service's email actually passes DKIM for your
domain.
Check your domain for free
Our free check reads your domain's SPF, DKIM and DMARC records and tells you in plain English what's wrong and how to fix it. No account needed, and we don't save what you check.