Guide
How to enable DKIM in Microsoft 365
DKIM signs your outgoing email so receivers can tell it really came from you. In Microsoft 365 you publish two CNAME records in DNS, then switch signing on for each domain.
Before you start
You need admin access to Microsoft 365 and to the DNS for your domain. DKIM is set up per custom domain, so repeat the steps for every domain that sends mail.
Step 1: find your two records
The two CNAME records have this shape, where example-co-uk is your domain with dots changed to dashes and contoso is your Microsoft 365 tenant name:
selector1._domainkey.example.co.uk CNAME selector1-example-co-uk._domainkey.contoso.onmicrosoft.com
selector2._domainkey.example.co.uk CNAME selector2-example-co-uk._domainkey.contoso.onmicrosoft.com
Microsoft shows the exact values for your domain in the Defender portal under Email & collaboration > Policies & rules > Threat policies > Email authentication settings > DKIM. Select the domain to see them.
Step 2: add the records in DNS
Create both CNAME records at your DNS provider. Some providers add the domain name automatically, so enter only selector1._domainkey if yours does. If your DNS is behind a proxy (for example Cloudflare), set these records to DNS only.
Step 3: switch signing on
Back in the same DKIM page, select the domain and turn on Sign messages for this domain with DKIM signatures. If Microsoft says the CNAME record doesn't exist, wait a while for DNS to update and try again. Newly added records can take some time to be visible.
Step 4: check it
Send a message to an outside mailbox and look at the message headers for dkim=pass with header.d= your own domain, not onmicrosoft.com. Or run the free check, which tests both selectors.
Why it matters for DMARC
DMARC needs SPF or DKIM to pass and align with your From domain. With DKIM signing off, Microsoft signs with its own onmicrosoft.com domain, which doesn't align. Turning DKIM on is usually what lets a domain move safely to p=reject.
Common questions
Why does Microsoft 365 use two DKIM selectors?
So it can rotate keys without breaking mail. One selector is in use while the other is ready to take over.
Do I need to do this for every domain?
Yes. DKIM is enabled separately for each custom domain in the tenant, including domains that send only occasionally.