SPF, DKIM and DMARC explained: a practical setup order for Microsoft 365

What each record does, the order to set them up in Microsoft 365, and the mistakes that send legitimate email to spam.

By Awais Waheed, , 7 min read

If your business email is landing in spam, or a recipient tells you your messages are failing checks, the cause is usually one of three DNS records: SPF, DKIM and DMARC. They work together, and they need to be set up in the right order. Here is what each one does and how I set them up for domains using Microsoft 365.

What each record does

RecordWhat it provesWhere it lives
SPFWhich servers are allowed to send email for your domainOne TXT record on the domain
DKIMThat the message was signed by your domain and was not altered in transitCNAME or TXT records on selector subdomains
DMARCWhat receivers should do when SPF or DKIM fail to align with your From address, and where to send reportsA TXT record at _dmarc.yourdomain.com

The key idea is alignment. DMARC passes only when SPF or DKIM passes and the domain they authenticate matches the domain in the visible From address. That is why a third-party newsletter tool can pass SPF for its own domain and still fail DMARC for yours.

The setup order I use

  1. List every service that sends as your domainMicrosoft 365, your website's contact form, your CRM, invoicing software, marketing platforms. Missing one here is the most common cause of later failures.
  2. Publish a single SPF recordFor a domain that only sends through Microsoft 365, the record is: v=spf1 include:spf.protection.outlook.com -all. Add an include: for each other sender that needs it.
  3. Enable DKIM in Microsoft 365In the Microsoft Defender portal, open the DKIM settings for your domain. It shows two CNAME records (selector1 and selector2). Create them at your DNS provider exactly as shown, wait for them to resolve, then enable signing.
  4. Start DMARC in monitoring modePublish v=DMARC1; p=none; rua=mailto:[email protected]. This changes nothing about delivery but starts sending you reports.
  5. Read the reports and fix the gapsReports show which sources are sending as your domain and whether they pass. Fix or remove anything legitimate that fails.
  6. Tighten the policyOnce legitimate mail consistently passes, move to p=quarantine, and later to p=reject if you want full protection against spoofing.

Common mistakes

  • Two SPF records. A domain must have only one SPF TXT record. Two records cause SPF to fail. Merge them into one.
  • Too many DNS lookups in SPF. SPF allows a maximum of 10 DNS lookups. Each include: can contain more. Remove services you no longer use.
  • Jumping straight to p=reject. Without a monitoring period you may block your own invoices or website forms.
  • Forgetting DKIM for other senders. Many platforms support DKIM signing with your domain. Enable it wherever possible so DMARC can pass through DKIM, which survives forwarding better than SPF.
  • Leaving old records after a migration. After moving from Google Workspace or another provider, remove the old provider's SPF include and DKIM records once they are no longer used.

Why this matters more now

Large mailbox providers now expect bulk senders to authenticate their mail. Google and Yahoo introduced sender requirements in 2024, and Microsoft followed for high-volume senders to its consumer Outlook.com service in 2025. Even if you are not a bulk sender, correct authentication improves deliverability and makes it much harder for attackers to impersonate your domain.

Checking your setup

Send a test message to an external mailbox and view the original headers. Look for spf=pass, dkim=pass and dmarc=pass in the Authentication-Results header. If any of them fail, the header usually says why.


Need help with this? I offer email migration and dns for businesses in the UK, US and worldwide.

Let's discuss your next IT project.

Tell me what you need and I'll reply with next steps.