Microsoft 365 signs and delivers your mail, but authentication of your custom domain is yours to set up. Microsoft’s own documentation covers it in three separate articles; here they are in one place, with the exact values and the change Microsoft made to DKIM in 2025.
The short version
| Record | Type | Name | Value |
|---|---|---|---|
| SPF | TXT | @ | v=spf1 include:spf.protection.outlook.com -all |
| DKIM 1 | CNAME | selector1._domainkey | given by Microsoft (see below) |
| DKIM 2 | CNAME | selector2._domainkey | given by Microsoft |
| DMARC | TXT | _dmarc | v=DMARC1; p=none; rua=mailto:dmarc@example.com to start |
Step 1: SPF
For a domain that sends only through Microsoft 365, Microsoft’s record is:
v=spf1 include:spf.protection.outlook.com -all
Microsoft recommends -all (hard fail) for Microsoft 365 domains, since DKIM and DMARC are also in place. Other points from its documentation:
- One SPF TXT record per domain or subdomain.
- Don’t flatten
include:spf.protection.outlook.com(replacing it with the IP addresses it contains): Microsoft changes those addresses. - There’s no portal or PowerShell command for SPF: you create the record at your DNS host.
- Government clouds use other includes (
spf.protection.office365.usfor GCC High and DoD,spf.protection.partner.outlook.cnfor 21Vianet).
If you also send through another service, add its include to the same record and check you stay under 10 DNS lookups with the SPF Checker.
Step 2: DKIM
Two CNAMEs, two formats
Microsoft 365 uses two selectors, selector1 and selector2, so it can rotate keys. You publish two CNAME records named selector1._domainkey and selector2._domainkey, pointing to keys Microsoft hosts.
The targets come in two formats:
- Since May 2025, for newly added custom domains, they end in
dkim.mail.microsoft, for exampleselector1-contoso-com._domainkey.contoso.n-v1.dkim.mail.microsoft. The single letter before-v1is assigned by Microsoft. - Older custom domains, and the initial domain, keep the previous format:
selector1-contoso-com._domainkey.contoso.onmicrosoft.com.
Don’t type these from memory: the exact values for your domain are shown in the Defender portal, or with PowerShell:
Get-DkimSigningConfig -Identity contoso.com | Format-List Name,Enabled,Status,Selector1CNAME,Selector2CNAME
Turn on signing
Once the CNAMEs are published:
- In the Defender portal: Email & collaboration > Policies & rules > Threat policies > Email authentication settings, DKIM tab (or directly security.microsoft.com/authentication). Open your domain and turn on Sign messages for this domain with DKIM signatures. The status should read “Signing DKIM signatures for this domain”.
- In PowerShell:
Set-DkimSigningConfig -Identity contoso.com -Enabled $true.
Until you do this, Microsoft 365 signs your mail with its onmicrosoft.com domain, which doesn’t align with your From: for DMARC.
Check both selectors with the DKIM Checker.
Step 3: DMARC
Microsoft’s rollout follows the usual order: start at p=none and read the reports, move to p=quarantine, then p=reject. Its advice worth borrowing: go through your subdomains first and keep the parent domain for last.
_dmarc.example.com TXT "v=DMARC1; p=none; rua=mailto:dmarc@example.com"
Two Microsoft-specific notes:
- Microsoft 365 doesn’t send forensic (
ruf=) reports. Rely onrua=. - Microsoft’s examples still include
pct=. DMARCbis (RFC 9989) removed that tag; leave it out. Our migration guide explains how to progress without it.
Don’t forget the onmicrosoft.com domain
Every tenant has an initial *.onmicrosoft.com domain. Microsoft recommends giving it a DMARC record too, even if you never send from it, as part of its parked domain guidance. Add it in the Microsoft 365 admin center: Domains, select the onmicrosoft.com domain, DNS records tab, Add record:
- Type TXT, name
_dmarc, valuev=DMARC1; p=reject
Apply the same logic to any domain you own but don’t send from: v=DMARC1; p=reject; stops anyone from using it.
Check the whole setup
- SPF Checker: one record,
spf.protection.outlook.comincluded - DKIM Checker:
selector1andselector2resolve - DMARC Checker: one record, with
rua= - Email deliverability test: send from Outlook with your address and confirm DKIM is signed with your domain, not
onmicrosoft.com
Further reading
Checked against Microsoft Learn (Defender for Office 365 email authentication articles) on November 21, 2026.