// how to fix
Set up SPF, DKIM and DMARC for Microsoft 365
A complete checklist to authenticate a domain that sends with Outlook in Microsoft 365: the SPF include, the two DKIM CNAME records, and a first DMARC record.
What it means
With Microsoft 365, Exchange Online sends your emails. Your domain must show receivers that it trusts Microsoft, with three DNS records:
- SPF lists Microsoft's servers as allowed senders.
- DKIM signs each email with a key linked to your domain.
- DMARC tells receivers what to do with emails that fail, and sends you reports.
If you never enabled DKIM for your custom domain, Microsoft signs with your onmicrosoft.com domain. That signature passes, but it does not match your From address, so it does not help your DMARC.
Why it matters
Gmail, Yahoo and Outlook.com expect SPF and DKIM, and DMARC for bulk senders. Microsoft itself rejects or junks more and more mail that fails these checks.
How to check
Delivmail checks this for you in two ways:
- Send a test email: on the home page (
/), copy your unique test address, send it a normal email from the mailbox you want to check, then open the report. SPF, DKIM and DMARC should all pass, with DKIM showingd=yourdomain.com. - Use the Domain scanner: type your domain at
/domain-scannerto read your SPF and DMARC records.
How to fix it
1. SPF
At your DNS provider, keep a single TXT record starting with v=spf1 on @. For Microsoft 365 alone:
v=spf1 include:spf.protection.outlook.com -all
If other tools send for you, add their includes to the same line. Use ~all while you are not sure the list is complete.
2. DKIM
- Open the Microsoft Defender portal and go to Email & collaboration, Policies & rules, Threat policies, Email authentication settings, then the DKIM tab.
- Select your custom domain. Microsoft shows two CNAME records, named
selector1._domainkeyandselector2._domainkey. - Copy the exact values shown in the portal: they point to a Microsoft host built from your domain and tenant names. Do not guess them.
- Add both CNAME records at your DNS provider.
- Wait until they are visible, then switch Sign messages for this domain with DKIM signatures to enabled.
Two selectors let Microsoft rotate keys without breaking anything. Keep both records forever.
3. DMARC
Add a TXT record named _dmarc:
v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com
Read the reports for a few weeks. Once every real source passes, move to p=quarantine, then p=reject.
4. Do not forget the rest
- Each extra tool (newsletters, invoices, website forms) needs its own SPF include and DKIM setup.
- If you also own the
onmicrosoft.comdomain only, there is nothing to do there: Microsoft manages it.
Check that it is fixed
- Run the Domain scanner again: one valid SPF record and one DMARC record.
- Send a new test email from Outlook: all three lines should pass, with DKIM signed by your own domain.
- With Delivmail DMARC monitoring in the paid dashboard, you can follow the daily reports before tightening your policy.
Check that it is fixed
DNS changes can take from a few minutes to a few hours. Then send a new test email or scan your domain again.
Related guides
- No SPF record on your domainYour domain does not say which servers may send email for it. Add one TXT record and receivers can tell your real emails from fakes.
- SPF error: too many DNS lookups (permerror)SPF allows at most 10 DNS lookups. Above that, the whole record breaks and receivers treat it as invalid. Here is how to slim it down.
- Several SPF records on one domainA domain must have only one SPF record. With two or more, SPF breaks for every email. Merge them into a single line.
- SPF fails: the sending server is not authorizedYour domain has an SPF record, but the server that sent your email is not in it. Find which service sent the email and add it.
- No DKIM signature on your emailsDKIM adds a digital signature that proves an email really comes from your domain. Turn it on in your email provider and publish its key in DNS.