Guide · Microsoft 365
SPF, DKIM and DMARC for Microsoft 365, step by step
If your business email runs on Microsoft 365 (Outlook, Exchange Online), these are the steps to stop criminals spoofing your domain and help your emails land in the inbox. Allow about an hour of work, then a few weeks of monitoring before the final step.
What you need
- A Microsoft 365 account with Global Administrator or Exchange Administrator rights.
- Access to your domain's DNS settings. This is usually where you bought the domain, or wherever your website is hosted (for example Hostinger, 123-reg, GoDaddy or IONOS).
- A list of every other service that sends email as your domain: invoicing (Xero, QuickBooks, Sage), newsletters (Mailchimp), website contact forms, CRM and booking systems.
Step 1: SPF
SPF lists the servers allowed to send email for your domain. At your DNS host, check for an existing TXT record at the root of the domain (often shown as @) that starts v=spf1. You must only ever have one.
If you only send through Microsoft 365, the record is:
v=spf1 include:spf.protection.outlook.com ~all
If other services send for you, add their include: value from their help pages before the ~all. Some services, including many newsletter tools, don't need an SPF entry at all because they send from their own domain and use DKIM instead; their help pages will say. Keep the total under 10 DNS lookups. The checker counts them for you.
Step 2: DKIM
Microsoft 365 signs outgoing mail with its own onmicrosoft.com domain by default. That signature doesn't match your domain, so it doesn't help your DMARC result. You need to turn on DKIM for your own domain. For Microsoft 365, DKIM uses two CNAME records rather than a TXT record.
- Sign in to the Microsoft Defender portal at security.microsoft.com.
- Go to Email & collaboration > Policies & rules > Threat policies > Email authentication settings and open the DKIM tab.
- Click your domain. The panel shows two CNAME records, named
selector1._domainkeyandselector2._domainkey. If it doesn't show them, use the option to create DKIM keys first. - At your DNS host, add both CNAME records exactly as shown. Copy the values rather than typing them: they're long, and the exact format depends on when the domain was added. Domains added to Microsoft 365 since May 2025 point to an address ending in
dkim.mail.microsoft; older domains point to youronmicrosoft.comdomain. - Wait for the records to take effect (usually within an hour, occasionally up to 48 hours), then return to the DKIM tab and switch on Sign messages for this domain with DKIM signatures.
If Microsoft says the CNAME records are missing, check for typos and for DNS hosts that automatically add your domain to the end of the record name. The name should be selector1._domainkey, not selector1._domainkey.yourdomain.co.uk.yourdomain.co.uk.
Remember the other services from your list. Most offer their own DKIM setup, often called "domain authentication". Turn it on for each one, because DMARC needs every legitimate sender to pass SPF or DKIM.
Step 3: DMARC in monitoring mode
Add a TXT record with the name _dmarc and this value, using an address you can receive mail at:
v=DMARC1; p=none; rua=mailto:dmarc-reports@yourdomain.co.uk; fo=1
Nothing is blocked yet. Receiving email providers start sending daily reports showing every server that sent mail using your domain, and whether it passed.
Step 4: Watch the reports for two to four weeks
Look for two things: your genuine services failing (fix them with SPF or DKIM) and senders you don't recognise (usually spoofing, which DMARC will block in the next step). Run the checker again to confirm SPF and DKIM pass.
Step 5: Enforce
When all your genuine mail passes, change p=none to p=quarantine, so failing mail goes to spam. After another couple of weeks without problems, change it to p=reject. That's full protection: receivers refuse email that fakes your domain.
Common Microsoft 365 problems
- Scanners and printers that email: if they send through Microsoft 365 with an account, they're covered. If they send directly from your office connection, add your office IP address to SPF (
ip4:203.0.113.10) or move them to Microsoft 365. - More than one domain: each domain needs its own SPF, DKIM and DMARC records, including domains you don't use for email. For those, publish
v=spf1 -allandv=DMARC1; p=reject;. - Email forwarded by others: SPF breaks when mail is forwarded, but DKIM usually survives. This is why turning on DKIM matters.
General guidance only. Menu names in Microsoft's portals change from time to time. If something doesn't match, Microsoft's own instructions are linked below. Test changes carefully: a wrong record can stop your email being delivered.