Turn on DKIM in Microsoft 365
Out of the box, Microsoft 365 signs your mail with its onmicrosoft.com domain. For DMARC to pass you need it signing with your own domain.
Before you start
You need Global Admin or Security Admin rights, and access to wherever your domain's DNS is hosted.
1. Get your CNAME records
- Open the Microsoft Defender portal at
security.microsoft.com. - Go to Email & collaboration → Policies & rules → Threat policies → Email authentication settings, then the DKIM tab.
- Click your domain. The panel shows two CNAME records, one for
selector1._domainkeyand one forselector2._domainkey.
2. Add them at your DNS host
Create both as CNAME records (not TXT). Copy the values exactly. If your DNS host is Cloudflare, set them to "DNS only" (grey cloud).
3. Switch on signing
Wait 15–60 minutes, go back to the DKIM tab and turn on Sign messages for this domain with DKIM signatures. If it complains the CNAMEs aren't found, wait a little longer. DNS hasn't caught up yet.
4. Check it
Run the DKIM checker with your domain. You should see a key on selector1 or selector2. Then send yourself an email at a Gmail address, choose "Show original" and look for DKIM: PASS with domain yourdomain.com.
Rotate to 2048-bit
Older tenants may still have 1024-bit keys. On the same DKIM page, use Rotate DKIM keys to move to 2048-bit.
Common questions
Do I need to do this for every domain?
Yes, each custom domain in the tenant that sends email needs its own two CNAMEs and signing turned on.
Will turning on DKIM break anything?
No. It only adds a signature. Mail keeps flowing while you set it up.