Guides · Updated October 29, 2026 · Not legal advice; provider rules change, so check the linked sources.

How to set up DKIM for Microsoft 365 (custom domain)

Microsoft 365 signs mail from your yourcompany.onmicrosoft.com address automatically, but not mail from your own domain until you publish two DNS records and switch signing on (Microsoft's DKIM guide). Without it, DMARC can only pass through SPF, and forwarded mail or a strict DMARC policy can send your messages to spam.

1. Get your exact CNAME values

Don't build the values by hand. Microsoft changed the format for domains added from May 2025, and older domains keep the old format, so copy what your tenant shows you:

Get-DkimSigningConfig -Identity yourdomain.com | Format-List Name,Enabled,Status,Selector1CNAME,Selector2CNAME

If the domain isn't listed, create the keys first with New-DkimSigningConfig -DomainName yourdomain.com -Enabled $false, then run the command above again.

The values look like one of these, with your own domain (dots turned into dashes) and tenant name:

selector1._domainkey  CNAME  selector1-yourdomain-com._domainkey.yourtenant.n-v1.dkim.mail.microsoft
selector2._domainkey  CNAME  selector2-yourdomain-com._domainkey.yourtenant.n-v1.dkim.mail.microsoft
(older domains)       CNAME  selector1-yourdomain-com._domainkey.yourtenant.onmicrosoft.com

2. Publish both records at your DNS host

3. Turn signing on

Once DNS has updated (minutes, sometimes longer), go back to the DKIM tab and switch on "Sign messages for this domain with DKIM signatures", or run:

Set-DkimSigningConfig -Identity yourdomain.com -Enabled $true

If it still says CnameMissing, check the records with dig CNAME selector1._domainkey.yourdomain.com +short (or nslookup -type=CNAME on Windows) and compare them character by character with the values from step 1.

4. Confirm it works

Want to know if DKIM is actually on? Run the free ExclusiveTrust scan. If you'd rather not touch DNS yourself, our managed fix sets up SPF, DKIM and DMARC for you, and Trust Monitor re-checks your records daily so a change doesn't quietly break them.