Cyber security for Irish small businesses

Email security

SPF, DKIM and DMARC on Microsoft 365: the records and the order

A new Microsoft 365 tenant sends your email with an SPF record you were told to add and a DKIM signature in Microsoft's name, not yours. Two CNAME records and one TXT record fix that, and Microsoft publishes the order to add them in.

By Oscar CobbeCurrent as at 4 minute read3 sources

What Microsoft 365 does by default

When you added your domain to Microsoft 365, the set-up asked you to publish an SPF record. Microsoft's own example for a domain that sends only through Microsoft 365 is v=spf1 include:spf.protection.outlook.com -all. That much is usually in place.

DKIM is the part that is usually missing. Microsoft signs every message, but for a custom domain it signs with your tenant's built-in name (yourcompany.onmicrosoft.com) until you switch on signing with your own. Microsoft's alignment table is plain about the result: a message from you@yourcompany.ie signed as yourcompany.onmicrosoft.com does not align, so for DMARC it counts as unsigned.

Microsoft's own advice is that SPF alone is not enough, and that DKIM and DMARC should follow.

Step 1: check the SPF record

Look up the TXT record at the root of your domain, or run the free email security check. You want exactly one record beginning v=spf1, with include:spf.protection.outlook.com in it and an include: for each other service that sends as you.

Microsoft recommends ending it -all for Microsoft 365 domains. Two records, or a record over ten DNS lookups, both make SPF return an error; our guide to the lookup limit covers that fix, including Microsoft's warning never to replace its own include: with addresses.

Step 2: turn on DKIM for your own domain

In the Microsoft Defender portal, go to Email & collaboration, then Policies & rules, then Threat policies, then the Email authentication settings page, and open its DKIM tab. Your custom domain is listed there with its signing switched off.

  1. 1Select the domain and create the DKIM keys. The portal then shows two CNAME records to publish.
  2. 2At your domain registrar or DNS host, create both. Their names are always selector1._domainkey and selector2._domainkey. Their values are specific to your tenant, so copy them from the portal, not from any example.
  3. 3Back in the portal, switch on "Sign messages for this domain with DKIM signatures". Microsoft says it can take a while to detect the new records, and signing starts once it has.

Keep both records

Microsoft asks for both CNAME records, and its portal offers to rotate the DKIM keys later. Leave both in place for as long as Microsoft 365 sends your mail.

Step 3: publish DMARC at p=none

DMARC is a TXT record named _dmarc at your domain. Microsoft's first step is a policy that changes nothing and asks for reports: v=DMARC1; p=none; rua=mailto: followed by a mailbox you will read. Microsoft suggests a shared mailbox or a Microsoft 365 group for the reports, not one person's inbox.

Microsoft describes the reports as XML attachments, usually compressed and usually sent once a day by each mail system that sends them. They list the servers that sent mail as your domain and whether each passed. Microsoft points to reporting services that turn the XML into something readable, and says Microsoft 365 itself does not send the per-message failure reports (ruf).

Step 4: quarantine, then reject

When the reports show your own mail passing, from every service that sends it, Microsoft's next step is p=quarantine, and then p=reject. Its guidance is to start with a domain or subdomain that sends little mail, go slowly, and save the main domain for last.

At reject, a receiving server is told to refuse mail that fails, which is the setting that stops invoices being sent in your name. Microsoft 365 applies the same rule to mail coming in: a message from a domain at p=reject that fails is refused with a 550 5.7.1 error, where the anti-phishing policy's "honour DMARC" setting is on, which Microsoft recommends.

Mail that leaves through another service

A newsletter tool, a booking system or an invoicing package that sends as your domain needs its own DKIM signature in your domain's name, set up in that service. Microsoft's troubleshooting table gives this as a reason DMARC fails for mail that passes SPF.

What to check when it is done

Send a message to a Gmail or Outlook.com address and open the headers. The Authentication-Results line should read spf=pass, dkim=pass with header.d= your own domain, and dmarc=pass. Then run the email security check again: it should show DKIM found under selector1 and selector2, and DMARC enforced.

Keep reading the reports. A new service added next year sends as you and fails until somebody adds it, and at p=reject that failure is a bounced email.

Sources

  1. 1.Set up SPF to identify valid email sources for your Microsoft 365 domain · Microsoft Learn
  2. 2.How to use DKIM for email in your custom domain · Microsoft Learn
  3. 3.Set up DMARC to validate email in Microsoft 365 · Microsoft Learn

Free, and no account needed

Check your Microsoft 365 domain, free

Reads your SPF, DKIM and DMARC records from public DNS and shows whether Microsoft's two DKIM selectors are published and what your DMARC policy tells receiving servers to do.

Run the free check

Email protection, €450 once

We find every service that sends as your domain, switch on DKIM for Microsoft 365 and for each of them, and move DMARC from none to reject once the reports show your own mail passing. A second scan shows it in place from outside.

See the prices

Who wrote this

Oscar Cobbe · Founder, FourWinds Digital

Writes and maintains the legal explainers on this site, and does the compliance work behind them. Every date and article number here is checked against the legislation itself before it is published, and each article shows the date it was last checked.

More about how we work →

Read next

More on Cyber security for Irish small businesses

Written on 29 October 2026; it describes the law as FourWinds read it on that date. This is general information about how the rules work, not legal advice on your situation. Where you need a solicitor, we say so. How we check the law.