Set up SPF, DKIM and DMARC for Microsoft 365
The three settings that keep Microsoft 365 messages out of spam, with Microsoft 365's own values and where to find them. Allow about fifteen minutes.
Published
Before you start
The records below are added where your domain's DNS is managed. That is often the company you bought the domain from, and not always Microsoft 365. If you aren't sure where that is, enter your domain: we name your DNS host and link to its guide.
Step 1. SPF: say who may send for you
Add one TXT record on your domain with the value below. It tells mail services that Microsoft 365 is allowed to send your email.
v=spf1 include:spf.protection.outlook.com -allBought Microsoft 365 through GoDaddy? Your SPF value is different:
v=spf1 include:secureserver.net -allIf your domain already has a record starting v=spf1, don't add a second. Edit the one you have so it includes Microsoft 365. Two SPF records cancel each other out.
Step 2. DKIM: sign your email
- Sign in to the Microsoft Defender portal (security.microsoft.com) as an administrator.
- Go to Email & collaboration, then Policies & rules, then Threat policies, then Email authentication settings, and open the DKIM tab.
- Select your domain. If it has no keys yet, choose Create DKIM keys.
- Copy the two CNAME records it shows and add both where your domain's DNS is managed, exactly as shown.
- Back in the Defender portal, switch on Sign messages for this domain with DKIM signatures.
Step 3. DMARC: say what happens to fakes
Add a TXT record named _dmarc with the value below. This starts in monitoring mode, which changes nothing about how your email is delivered.
v=DMARC1; p=none;After a few weeks with SPF and DKIM both working, change p=none to p=quarantine. Fake emails then go to spam.
Step 4. Check it worked
Changes can take up to an hour to show. Then run the check here: it reads all three records and tells you if anything is still missing.