Based on Microsoft's documentation (as of November 2026) for the standard Microsoft 365 cloud. Government clouds and 21Vianet use different values.
1. SPF
A TXT record for the root domain, added at your DNS host:
example.com. IN TXT "v=spf1 include:spf.protection.outlook.com -all"Microsoft recommends ending with -all and a TTL of at least 3600 seconds, but set -all only once every sender is in the record. Add other sending systems to the same record. Microsoft explicitly advises against flattening its include into a list of IP addresses, because those addresses change.
2. DKIM
Without your own setup, Microsoft 365 signs mail with the *.onmicrosoft.com domain. That signature is not aligned with the sender's domain, so it does not help DMARC.
Step 1: get the record values
Each custom domain needs two CNAME records: selector1._domainkey and selector2._domainkey. Microsoft generates their targets, and you should copy them rather than build them by hand. The most reliable way is PowerShell (Exchange Online):
Get-DkimSigningConfig -Identity example.com | Format-List Name,Enabled,Status,Selector1CNAME,Selector2CNAMEOr use the Microsoft Defender portal (see step 3), which shows the values when you select the domain.
Step 2: add the CNAME records
For domains added since May 2025 the targets use a new format, for example:
selector1._domainkey.example.com. IN CNAME selector1-example-com._domainkey.example.n-v1.dkim.mail.microsoft.
selector2._domainkey.example.com. IN CNAME selector2-example-com._domainkey.example.n-v1.dkim.mail.microsoft.Older domains use the selector1-example-com._domainkey.example.onmicrosoft.com format. The parts after _domainkey depend on your tenant, so the lines above are only an example.
Step 3: turn signing on
In the Microsoft Defender portal go to Email & collaboration → Policies & rules → Threat policies → Email authentication settings (directly: security.microsoft.com/authentication), DKIM tab. Click the domain and turn on Sign messages for this domain with DKIM signatures. Microsoft usually detects new CNAME records within minutes; if the portal reports an error, wait for DNS propagation and try again.
According to the documentation the default key is 1024 bits; in PowerShell (the KeySize parameter) you can set 2048, which is safer. The two selectors let keys be replaced without a gap in signing.
3. DMARC
A starter TXT record at _dmarc:
_dmarc.example.com. IN TXT "v=DMARC1; p=none; pct=100; rua=mailto:[email protected]"Microsoft describes the same gradual rollout: none, then quarantine, finally reject (see DMARC reports: from p=none to p=reject). Domains you never send from can get v=DMARC1; p=reject straight away.
4. Checking
dig +short TXT example.com | grep spf1
dig +short CNAME selector1._domainkey.example.com
dig +short TXT _dmarc.example.comIn the headers of a message sent from Outlook, look for dkim=pass header.d=example.com (your domain, not onmicrosoft.com) and dmarc=pass. The domain audit in the MailSpecto panel checks all the records at once, and DMARC reports in MailSpecto Monitor show whether mail from Microsoft 365 and your other systems passes authentication.
- One SPF record with
include:spf.protection.outlook.com. - Two DKIM CNAME records copied from the portal or PowerShell.
- DKIM signing turned on in the Defender portal.
- A
_dmarcrecord withp=noneand anruaaddress. - In the headers:
dkim=passwith your domain anddmarc=pass.
Keep your contact list clean
Verify email addresses before you send, and explore our upcoming SPF/DKIM/DMARC diagnostics module.
MailSpecto Engineering Team
We build tools for email address verification, deliverability monitoring and mail infrastructure security diagnostics for companies in Poland and Europe.