Setting up DKIM takes four steps: generate a key in your email provider, publish the DNS record it gives you, wait until the record is visible, then switch signing on. In Google Workspace that is a TXT record under the google selector; in Microsoft 365 it is two CNAME records, selector1 and selector2. Afterwards, check the key with the DKIM record checker and send a test email.
Before you start
- You need admin access to your email provider (in Google Workspace, a super administrator) and to the DNS host where your domain's records live. Not sure which DNS host that is? Look up the NS records with the DNS lookup.
- List every service that sends email as your domain: the mailbox provider, a newsletter tool, your CRM, the shop or invoicing system. Each one signs with its own key, so each needs its own DKIM set-up.
- Check what is there now with the email deliverability checker; it tries 35 common selectors.
Google Workspace
- In the Google Admin console go to Menu → Apps → Google Workspace → Gmail → Authenticate email.
- Choose your domain and click Generate New Record. Pick the 2048-bit key if your DNS host supports it (Google's recommendation; choose 1024 only if it doesn't). Keep the prefix selector
googleunless your domain already has a key with that name. - Copy the DNS Host name (
google._domainkey) and the TXT record value (starts withv=DKIM1; k=rsa; p=). - At your DNS host, add a TXT record with that host name and value. If the host splits long values, paste the whole value anyway; never trim it.
- Back in the Admin console, click Start authentication.
Google notes two waits: after you turn on Gmail for a new organisation, it can be 24–72 hours before you can get the DKIM key, and after adding the key it can take up to 48 hours for DKIM to start working (Google Workspace Admin Help, "Set up DKIM").
Microsoft 365
- Open the Microsoft Defender portal at security.microsoft.com/authentication (Email & collaboration → Policies & rules → Threat policies → Email authentication settings) and select the DKIM tab.
- Click your custom domain. The details pane shows the two CNAME records to publish: hosts
selector1._domainkeyandselector2._domainkey, pointing at names Microsoft gives you. Domains added since May 2025 point at names ending indkim.mail.microsoft; older ones end inonmicrosoft.com. Copy the exact values from the portal. - Add both CNAME records at your DNS host.
- Back on the DKIM tab, turn on Sign messages for this domain with DKIM signatures. If the portal says it can't find the records yet, wait a while and try again: Microsoft says detection takes a few minutes or longer.
Microsoft's documentation lists 1024 bits as the default key size, with 2048 available (Microsoft Learn, "Set up DKIM to sign mail from your Microsoft 365 domain", updated August 2026). Microsoft rotates between the two selectors, which is why there are two records.
Other senders (newsletters, CRM, shop)
Look for "domain authentication", "sender authentication" or "DKIM" in each tool's settings. Most give you one to three CNAME or TXT records with their own selectors. Add them exactly as given, then press the tool's verify button. Without this, those emails are signed with the tool's own domain, which doesn't count for your DMARC.
Check that it works
- Run the DKIM record checker with your domain and selector. You want "Valid key" and, ideally, 2048 bits.
- Send an email to a Gmail address, open it, choose Show original and look for
DKIM: 'PASS' with domain yourdomain.com. - Run the email deliverability checker to see SPF, DKIM and DMARC together.
Common DKIM set-up mistakes
| Mistake | Symptom | Fix |
|---|---|---|
Host typed as google._domainkey.example.com at a DNS host that adds the domain itself | Record ends up at google._domainkey.example.com.example.com; checker says not found | Use just google._domainkey |
| Part of the key lost when pasting | "Key doesn't decode" in the checker | Copy the full value again from the provider |
| Signing never switched on | Key is valid, but emails show no DKIM signature for your domain | Click Start authentication (Google) or turn signing on (Microsoft) |
| Only the mailbox provider set up | DMARC reports show DKIM failing for newsletters | Set up DKIM in each sending tool |
With DKIM passing, the next step is DMARC: start at p=none to collect reports, then move to quarantine and reject. The DMARC guide and the DMARC record generator walk you through it.
Frequently asked questions
Do I need DKIM if I already have SPF?
Yes. SPF breaks when mail is forwarded; DKIM survives forwarding. Google and Yahoo require bulk senders to have both, and DMARC works best with both.
Should I use a 1024-bit or 2048-bit key?
2048-bit, if your DNS host accepts the longer record. RFC 8301 requires at least 1024 bits and recommends 2048.
Can I change my DKIM key later?
Yes. Publish the new key under a new selector, switch signing to it, and remove the old record after a few days, when no emails in transit still use it.


