How to Set Up DMARC, DKIM and SPF for Microsoft 365
SPF, DKIM, and DMARC are DNS records that prove your emails are legitimate and prevent attackers from spoofing your domain. Without them, anyone can send email pretending to be from your domain. This guide covers setting all three up for Microsoft 365 in the correct order.
How SPF, DKIM, and DMARC work
- SPF - lists the servers allowed to send email for your domain. Receiving servers check this list and reject email from unlisted servers.
- DKIM - adds a cryptographic signature to outgoing email. Receiving servers verify the signature to confirm it was not tampered with.
- DMARC - tells receiving servers what to do when SPF or DKIM fails, and sends you reports about who is sending from your domain.
Set up SPF
Add a TXT record at your root domain (@):
v=spf1 include:spf.protection.outlook.com -all
If you send from other services add their includes before -all:
v=spf1 include:spf.protection.outlook.com include:servers.mcsv.net -all
Set up DKIM
- Select your domain and click Enable
- Microsoft shows you two CNAME records to add to DNS
- Add both CNAMEs to your DNS provider
- Wait for DNS propagation (up to 48 hours) then enable DKIM
Set up DMARC
Add a TXT record at _dmarc.yourdomain.com. Start with monitoring mode:
v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com; fo=1
Verify your setup
Use MXToolbox to check all three are working:
https://mxtoolbox.com/SuperTool.aspx SPF: spf:yourdomain.com DKIM: dkim:yourdomain.com:selector1 DMARC: dmarc:yourdomain.com
Moving DMARC to enforcement
After collecting DMARC reports for 2-4 weeks and confirming no legitimate sources are failing:
- Change p=none to p=quarantine with pct=10 to test on 10% of traffic
- Monitor for 1-2 weeks
- Increase to pct=100
- Change to p=reject when confident all legitimate sources pass
Frequently Asked Questions
Legitimate email from services not yet covered by SPF or DKIM will be rejected. Always start with p=none, collect reports, identify all sending sources, then move to enforcement.
Yes. SPF and DKIM alone do not prevent spoofing - they provide the signals. DMARC tells receiving servers what to do when those signals fail.
DMARC reports are XML files sent to your rua email. Tools like dmarcian.com or DMARC Analyzer make them readable.