Email

How to turn on DKIM for your domain in Microsoft 365

In short. DKIM is an invisible signature added to every email, proving that it really comes from your domain and was not altered along the way. Without one in your name, your emails risk being sent to spam or rejected, and DMARC protection (the rule against someone impersonating your domain) cannot rely on it. It is up to you, or to your IT provider, to create two lines at your domain host (in its directory, the DNS), then turn the signature on in Microsoft 365. Allow a few minutes of configuration, plus the time for those lines to become visible on the Internet.

To turn on DKIM in Microsoft 365, open the Microsoft Defender portal at https://security.microsoft.com/authentication?viewid=DKIM, note the two CNAME records (selector1._domainkey and selector2._domainkey) it gives for your domain, create them at your DNS host, then switch on Sign messages for this domain with DKIM signatures. Copy the values from the portal: their format changed in May 2025.

DKIM adds a signature to every email. The recipient checks it against a key published in your DNS, so they know the message really comes from your domain and wasn't altered on the way. It's also what lets DMARC pass when an email is forwarded.

Last verified: November 18, 2026, against Microsoft's official documentation.

What Microsoft 365 does without you

With no setup, Microsoft 365 signs your email with its own .onmicrosoft.com domain, not yours. The signature is valid, but it isn't "aligned" with the sender address, so it doesn't count for DMARC. That is why checkers often report DKIM as missing on a Microsoft 365 domain.

Step 1: open the DKIM settings

You need an admin account with access to security policies in the Defender portal.

  1. Open https://security.microsoft.com/authentication?viewid=DKIM. Through the menus: Email & collaboration > Policies & rules > Threat policies > Email authentication settings, then the DKIM tab.
  2. Find the row for your custom domain. Its Toggle is Disabled.

Labels checked on November 18, 2026 in Microsoft's English documentation. The direct address is the most stable way in.

Step 2: note the two CNAME records

  1. Try to slide the Toggle for your domain to Enabled. A Client error dialog opens. That's expected: the CNAME records don't exist yet. Select OK.
  2. The domain's Status changes to CnameMissing. Click the row (not the check box or the toggle) to open the details flyout.
  3. In the Publish CNAMEs section, note the two values or select Copy. Leave the flyout open.

For a domain added since May 2025, the values look like this:

Name (host)TypeValue
selector1._domainkeyCNAMEselector1-your-domain-com._domainkey.yourorganization.n-v1.dkim.mail.microsoft
selector2._domainkeyCNAMEselector2-your-domain-com._domainkey.yourorganization.n-v1.dkim.mail.microsoft

An older domain keeps the old format: selector1-your-domain-com._domainkey.yourorganization.onmicrosoft.com. The letter before -v1 (n, r…) is assigned by Microsoft and can't be guessed. The two formats can't coexist for the same selector, so always copy the values the portal shows, never those of an example.

Step 3: create the CNAME records at your DNS host

At your DNS host, add two CNAME records:

  • Name / host: selector1._domainkey, value: the portal's value for selector1;
  • Name / host: selector2._domainkey, value: the portal's value for selector2.

Two common traps:

  • The doubled name: if your host adds the domain itself, typing selector1._domainkey.your-domain.com creates selector1._domainkey.your-domain.com.your-domain.com. Type only selector1._domainkey.
  • The trailing period: some hosts require a period at the end of the value, others reject it. Follow the example in your host's interface.

Microsoft takes a few minutes, sometimes longer, to detect the new CNAME records.

Step 4: turn on signing

  1. Go back to the details flyout you left open.
  2. Switch on Sign messages for this domain with DKIM signatures. A message says synchronization can take several minutes. Select OK.
  3. If the CNAME records are detected, the flyout shows the toggle as Enabled, a status saying DKIM signing is in progress for this domain, and the Rotate DKIM keys button becomes available.

If the status stays on CnameMissing, wait for DNS propagation, check the spelling of both names, then try again.

Check your domain for free. AttackScout reads the Microsoft 365 DKIM selectors (selector1 and selector2), your SPF and your DMARC, and tells you whether your domain is ready for a strict DMARC policy. Run the audit

Step 5: check it works

  1. Send an email from Outlook to a personal Gmail mailbox, open it and choose Show original.
  2. Look for DKIM: 'PASS' with your domain, and in the DKIM-Signature header a d=your-domain.com value and a selector such as s=selector1-your-domain-com.

In PowerShell (Exchange Online module), this command shows the state and the expected CNAME records:

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

Moving to a 2,048-bit key

The key created by default in PowerShell is 1,024 bits. Microsoft lets you move to 2,048 bits during a rotation: use the Rotate DKIM keys button in the flyout, or PowerShell:

Rotate-DkimSigningConfig -Identity your-domain.com -KeySize 2048

The rotation isn't immediate: it takes four days (96 hours), during which you can't start another one. The new size applies to the selector that becomes active during this rotation.

Frequently asked questions

Do I need to set up DKIM for every domain?

Yes. Every domain and subdomain that sends email from Microsoft 365 needs its two CNAME records and signing switched on.

What about a domain that sends no email?

Don't publish DKIM. Microsoft recommends this: with no published key, a forged email using that domain can't pass DKIM. Publish an SPF record v=spf1 -all and a DMARC p=reject instead.

Is DKIM enough against spoofing?

No. You also need SPF and DMARC: DMARC is what says what to do with an email that fails.

Technical details

Exact configuration. Two CNAME records, with values copied from the portal:

selector1._domainkey.your-domain.com.  CNAME  selector1-your-domain-com._domainkey.yourorganization.n-v1.dkim.mail.microsoft.
selector2._domainkey.your-domain.com.  CNAME  selector2-your-domain-com._domainkey.yourorganization.n-v1.dkim.mail.microsoft.

Why two selectors. Microsoft 365 generates two key pairs: only one signs at any given time, the other is kept for the next rotation. The CNAME records point to public keys hosted by Microsoft, which can therefore change them without you touching DNS.

To check it yourself.

dig +short CNAME selector1._domainkey.your-domain.com
dig +short TXT selector1._domainkey.your-domain.com

Reference: https://www.rfc-editor.org/rfc/rfc6376

Sources

Accessed November 18, 2026.