Guide per mail provider

Set up DKIM for Microsoft 365

DKIM signs outgoing mail with a key whose public part lives in your domain’s DNS. This guide shows which records Microsoft 365 requires for that and what to do in the Microsoft 365 admin interface.

Microsoft 365: all records at a glance

The DKIM records for Microsoft 365

Microsoft 365 uses two selectors, selector1 and selector2, and publishes the keys on its side rather than yours: you create two CNAME records pointing to Microsoft. That lets Microsoft swap keys without you touching DNS; only one of the two selectors is active at a time.

The CNAME target depends on when the domain was added. For domains added since May 2025 the targets end in dkim.mail.microsoft, older domains keep the format with onmicrosoft.com. The Defender portal shows the exact values for the domain; guessing or copying from another tenant does not work.

As long as DKIM is not enabled, mail from the custom domain gets no DKIM signature according to Microsoft. The key is 1024 bits by default; you switch to 2048 bits in PowerShell with Rotate-DkimSigningConfig, and the rotation takes four days.

DNS
selector1._domainkey  CNAME  selector1-example-com._domainkey.example.n-v1.dkim.mail.microsoft
selector2._domainkey  CNAME  selector2-example-com._domainkey.example.n-v1.dkim.mail.microsoft

How to set up DKIM for Microsoft 365

The steps in the Microsoft 365 admin interface and at the DNS host:

  • In the Microsoft Defender portal open “Email & collaboration”, “Policies & rules”, “Threat policies” and then “Email authentication settings”, and switch to the “DKIM” tab.
  • Select the domain and choose “Create DKIM keys”; the portal shows the two CNAME records with their targets.
  • Create both CNAMEs at the DNS host: selector1._domainkey and selector2._domainkey, each with the target shown.
  • Back in the portal enable “Sign messages for this domain with DKIM signatures”. If the portal reports “CnameMissing”, the records are not visible yet; it takes a few minutes or longer for Microsoft to detect them.

Click path at Microsoft 365

Official guide from Microsoft 365: How to use DKIM for email in your custom domain(opens in a new tab)retrieved 10 Nov 2026

Publishing at the DNS host

DKIM records always live at selector._domainkey. Most DNS editors append the domain themselves, so you only enter the part before it. CNAME records for DKIM must not sit behind a proxy. The guides per host below show where the record is created in the respective DNS editor.

Verify and keep an eye on it

The DKIM checker below queries the key under the selector and checks structure and length. You see whether the records for Microsoft 365 are publicly visible. DomainWarn keeps checking them afterwards and alerts you when a key disappears or changes.

Frequently asked questions

Why does my Microsoft 365 CNAME point to onmicrosoft.com and not dkim.mail.microsoft?
Both formats are valid. Domains added before May 2025 keep the target under onmicrosoft.com, newer ones get dkim.mail.microsoft. What counts is what the Defender portal shows for your domain.
Does Microsoft 365 sign my mail without setting up DKIM myself?
Not for the custom domain: according to Microsoft, no DKIM signing occurs for outbound mail from custom domains until DKIM is enabled. Only senders under onmicrosoft.com are signed automatically.
What is a DKIM selector?
The name under which a key lives in DNS: selector._domainkey.your-domain.com. Every service sending for the domain uses its own selectors, which is why several DKIM records do not interfere.
Check now

Free DKIM record check and lookup: selector, key type, key length, syntax and revoked keys. Leave the selector empty to try common selectors automatically.

DomainWarn checks SPF, DKIM, DMARC, DNS and certificates of all client domains regularly and reports changes before mail lands in spam.

Monitor this domain continuously14-day free trial, no credit card.

Publishing at your host

The mail provider specifies the value; it is created at the domain’s DNS host. Pick your host for the way to the DNS editor.

All hosts at a glance

The same guide for other mail providers

All mail providers at a glance