Out of the box, Microsoft 365 signs outgoing mail with the tenant's onmicrosoft.com domain. That signature is valid, but it does not align with the client's own domain, so it does nothing for DMARC. Turning on DKIM for each custom domain fixes that. It takes about 15 minutes per domain.
Before you start
- An admin role that can manage email authentication (Security Administrator or Global Administrator).
- Access to the domain's DNS.
- The custom domain already added and verified in Microsoft 365.
Step 1: get the two CNAME values
In the Microsoft Defender portal, go to Email & collaboration → Policies & rules → Threat policies → Email authentication settings and open the DKIM tab. Select the domain. If no keys exist yet, the portal offers to create them and then shows two CNAME records:
selector1._domainkey.example.com CNAME <value shown in the portal> selector2._domainkey.example.com CNAME <value shown in the portal>Copy the targets exactly from the portal. Their format depends on when the tenant was set up: older tenants point at a host under onmicrosoft.com, newer ones at a Microsoft-managed host under dkim.mail.microsoft. Guessing the format is the most common reason this fails.
The same values are available in Exchange Online PowerShell with Get-DkimSigningConfig -Identity example.com | Format-List Selector1CNAME, Selector2CNAME.
Step 2: publish both records
Add both CNAMEs at the DNS host. Two details catch people out:
- Many DNS panels append the domain automatically, so the host field is just
selector1._domainkey, not the full name. - On Cloudflare, CNAME records for DKIM must be DNS only (grey cloud), not proxied.
Step 3: enable signing
Back on the DKIM tab, switch on Sign messages for this domain with DKIM signatures. If the portal reports that the CNAME records are not found, give DNS a little longer and retry. In PowerShell: Set-DkimSigningConfig -Identity example.com -Enabled $true.
Step 4: verify
- Send a message from the domain to a Gmail or Outlook.com address.
- Open the original message and find
Authentication-Results. You wantdkim=pass header.d=example.com, the custom domain, notonmicrosoft.com. - Check that
dmarc=passappears too.
A free Hookgap check also looks for selector1 and selector2 when it detects Microsoft 365 MX records, and reports DKIM as found.
Common problems
- "CNAME record does not exist": a typo in the host name, the domain added twice by the DNS panel, or the record still propagating.
- Only one selector published: signing may work today and break at the next key rotation. Publish both.
- Several domains in the tenant: each custom domain, including ones used only for aliases, needs its own pair of records and its own toggle.
- Other senders: this covers mail sent through Exchange Online only. CRMs, newsletters and invoicing tools need their own DKIM. Find them in DMARC aggregate reports.
What comes next
With aligned DKIM in place for Microsoft 365, the client is ready for a DMARC rollout: the complete guide has the plan. For encrypted delivery to the domain, see MTA-STS for Microsoft 365.
Frequently asked questions
Does Microsoft 365 sign email with DKIM by default?
It signs with the tenant's onmicrosoft.com domain. That signature does not align with a custom domain, so DMARC relies on SPF alone until you enable DKIM for the custom domain.
Why does Microsoft 365 use two DKIM selectors?
selector1 and selector2 let Microsoft rotate keys: one is active while the other is prepared. Both CNAME records must exist for signing and rotation to work.
How long do the DKIM CNAME records take to work?
Usually minutes, but DNS changes can take longer depending on TTLs. If the portal says the records are not found, wait and try again before changing anything.
Keep reading
find DKIM selector · 6 min read
How to find a domain's DKIM selector (and why you can't list them all)
Three reliable ways to find the selector, the common defaults by provider, and why "DKIM missing" is a claim no outside tool can make.
Guide · 13 min read
SPF, DKIM and DMARC explained: the complete guide for MSPs
How the three email authentication records fit together, with real examples, alignment explained and a rollout plan that does not break mail.
Google Workspace DKIM setup · 6 min read
Google Workspace DKIM, SPF and DMARC setup checklist
SPF, DKIM and DMARC for a Google Workspace domain, in the order that avoids broken mail, with how to check each step.