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.

Before you start: run the free checker on your domain. It shows which of these steps are already done.

What you need

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.

  1. Sign in to the Microsoft Defender portal at security.microsoft.com.
  2. Go to Email & collaboration > Policies & rules > Threat policies > Email authentication settings and open the DKIM tab.
  3. Click your domain. The panel shows two CNAME records, named selector1._domainkey and selector2._domainkey. If it doesn't show them, use the option to create DKIM keys first.
  4. 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 your onmicrosoft.com domain.
  5. 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

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.

Sources