Guides · Email security · Updated 2026-12-04

Microsoft 365: set up SPF, DKIM and DMARC for your domain

Microsoft 365 does not sign email with your own domain until you enable DKIM, and it does not create SPF or DMARC records for you. Without all three, Outlook.com, Gmail and Yahoo may reject or junk your email.

SPF

Publish one TXT record at the root of your domain. If other services send as your domain, add their includes to the same record.

v=spf1 include:spf.protection.outlook.com -all

DKIM

In the Microsoft Defender portal open Email & collaboration → Policies & rules → Threat policies → Email authentication settings → DKIM. Select your custom domain. Microsoft shows two CNAME records (selector1._domainkey and selector2._domainkey). Copy the exact values shown there into your DNS – their target format depends on your tenant, so do not copy them from another guide. After DNS has updated, switch “Sign messages for this domain with DKIM signatures” to enabled.

DMARC

Add a TXT record named _dmarc. Start with monitoring and follow our DMARC guide to reach reject.

v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com

Check the result

Run our email security check with the DKIM selector “selector1”. All three should show OK.

Questions

My domain is on GoDaddy / another registrar. Where do I add the records?
In the DNS management of whoever hosts your DNS (your registrar, Cloudflare or your web host). The records are the same everywhere.
Do I keep the onmicrosoft.com domain records?
Yes. The initial onmicrosoft.com domain is handled by Microsoft; you only add records for your own custom domain.

General technical information, not legal advice or a security audit. Record values shown are examples: use the exact values from your own email provider.