Facebook tracking pixel

MailGenius

Set Up DKIM for Office 365 Your 2026 Deliverability Guide

Let's get straight to it. If you’re running your business on Microsoft 365, setting up DKIM isn't just a good idea anymore—it's the difference between your emails being delivered and disappearing into a digital black hole. Major email providers are now flat-out rejecting unauthenticated mail, so without it, your invoices, sales pitches, and marketing campaigns might as well not exist. This is about protecting your reputation and your revenue.

Why DKIM for Office 365 Is Mission-Critical

Laptop displaying an email notification next to a speech bubble with 'PROTECT DELIVERABILITY' text.

Think of DKIM (DomainKeys Identified Mail) as a tamper-proof digital seal on your emails. It’s a cryptographic signature that proves to receiving servers like Gmail and Outlook that your message is genuinely from your domain and hasn't been messed with along the way. Without that seal, your emails look suspicious—and they’re first in line for the spam folder or outright rejection.

Just a few years ago, DKIM was a "nice-to-have." Today, it's a foundational piece of your email infrastructure.

The New Rules of the Inbox

The email game changed for good when the big providers put their foot down. It started in early 2024 when Google and Yahoo began requiring SPF, DKIM, and DMARC for anyone sending over 5,000 emails a day. Then, in 2025, Microsoft jumped in, announcing that Outlook.com would also start rejecting messages from high-volume senders who weren't authenticated. This solidified authentication as the absolute baseline for deliverability.

So what does this mean for your business? If you use Office 365 for any of the following, you need DKIM set up right now:

  • Email Marketing: Your promotional campaigns and newsletters must reach subscriber inboxes, not their junk folders.
  • Sales Outreach: Keep your cold emails and crucial follow-ups from being flagged as spam before they're even read.
  • Transactional Emails: Guarantee that vital messages like password resets, shipping notifications, and order confirmations are delivered instantly.
  • Internal Communications: Protect your own team from spoofing attacks where scammers impersonate your executives or HR department.

"I see it all the time. A business spends thousands on a marketing campaign, only for half the emails to bounce because they skipped a 30-minute DKIM setup. It's the most expensive mistake you can make in email marketing." – Troy Ericson, MailGenius

Before diving into the setup, it helps to see what a difference this one change can make.

Your Email Deliverability With vs Without DKIM

This quick comparison shows the real-world impact of DKIM compliance on where your emails actually land.

Metric Authenticated Email (With DKIM) Unauthenticated Email (Without DKIM)
Inbox Placement High Low (often goes to spam)
Delivery Rejection Rate Very Low High (especially for bulk senders)
Sender Reputation Positive and builds over time Negative, easily damaged
Spoofing Protection Protected from domain impersonation Vulnerable to spoofing attacks

The data is clear: authenticated emails perform better across the board, building a trustworthy reputation that unauthenticated mail simply can't achieve.

More Than Just Deliverability

Beyond just landing in the inbox, a proper DKIM setup for Office 365 directly boosts your sender reputation. Every single email that passes a DKIM check reinforces to providers that your domain is legitimate. Over time, this builds a positive sending history, making it even easier for your future emails to get delivered.

On the flip side, sending emails without DKIM makes your domain an easy target for spoofers. Scammers can send malicious emails that look like they came from you, damaging your brand, tricking your customers, and potentially getting your domain blacklisted. Implementing DKIM is a fundamental step that aligns with broader email security best practices.

Before you touch a single DNS setting, you need a baseline. The best way to get one is to run a free email spam test on the MailGenius.com homepage. It will give you an instant deliverability score and show you exactly how email servers see your messages right now. After we get DKIM configured, you can run another test and see the improvement for yourself.

Your Pre-Flight Checklist Before Touching DNS

Hands holding a tablet displaying 'Verify Domain, Find DNS Host' on a wooden desk with office items.

Before we even think about creating a DKIM record, let's get our house in order. Diving straight into your DNS settings without a plan is a recipe for disaster. Trust me, a few minutes of prep work here will save you hours of headaches later.

The goal is to gather all the necessary info so the actual setup is smooth and error-free. Let's start with the most common hurdle I see trip people up.

Confirm Your Domain Is Verified in Office 365

First things first: Microsoft won't sign emails for a domain it doesn't know you own. You absolutely must have your custom domain (like yourcompany.com) properly added and verified within your Microsoft 365 tenant.

If you’re already sending and receiving emails with your custom domain, you’re probably good to go. But if you're setting this up for a new domain, it's a non-negotiable step. Skipping it means the entire DKIM process will fail before it even starts.

My personal advice? Run a quick email spam test on MailGenius.com right now. This gives you a baseline score so you can see the direct, measurable impact of your work once you successfully set up DKIM for Office 365.

Identify Who Controls Your DNS

Next, you need to know exactly where your DNS records live. This is your domain's control panel on the internet, and it’s where we’ll be adding the DKIM records.

Your DNS host is typically one of the following:

  • Your Domain Registrar: Companies like Namecheap or Google Domains where you bought the domain name.
  • Your Web Host: Services like GoDaddy, Bluehost, or SiteGround that also host your website.
  • A DNS Service: Specialized providers like Cloudflare or Amazon Route 53.

Knowing your DNS host tells you where to log in. Before you make any changes, a solid understanding of mastering domain and DNS management can prevent common pitfalls. It's not just about finding a password; it’s about making sure you have the right permissions to add CNAME records, which is what Microsoft requires.

If you're unsure who manages your DNS, a simple audit can point you in the right direction. You can get a quick overview by running a DNS audit on MailGenius to see your current nameservers.

Find Your .onmicrosoft.com Initial Domain

Finally, you need your organization's initial domain—the one Microsoft assigned when you created your tenant. It usually follows the yourcompany.onmicrosoft.com format. This value is a key piece of the puzzle, as it forms part of the CNAME record we'll be creating later.

To find it, just head to the Microsoft 365 admin center and look under Settings > Domains. It will be listed there, often marked as the "fallback" domain.

Copy this down—you'll need it very soon. With these three items checked off, you’re ready to get to work.

Generating Your DKIM Keys in Microsoft Defender

Alright, time to get the actual "ingredients" from Microsoft to authorize your domain. We're going to sidestep the dense technical manuals and I’ll show you exactly how to generate your DKIM keys—the right way, the first time. This step is all about getting the specific codes you’ll need to plug into your DNS provider.

We’ve got two clear paths to get this done. The first is a straightforward point-and-click method inside the Microsoft 365 Defender portal, which is the best route for most people. The second is for those who are more comfortable on the command line, using a couple of simple PowerShell commands.

No matter which path you choose, you'll walk away with the exact CNAME records needed to set up DKIM for Office 365. No guesswork, no confusion—just the precise values straight from the source.

The Defender Portal Method

Let's start with the visual approach. Microsoft has done a good job centralizing most security settings into the Defender portal, which makes this process a lot easier than it used to be.

First, you need to navigate to the right spot. Log in to the Microsoft 365 Defender portal at security.microsoft.com. Once you're in, find your way to the DKIM settings page.

You can usually get there by following this path:

  • On the left navigation pane, go to Email & collaboration.
  • Select Policies & rules.
  • Click on Threat policies.
  • Under the "Rules" section, choose DKIM.

Once you land on the DKIM page, you'll see a list of your domains. Find and select the custom domain you want to configure. If DKIM hasn’t been set up yet, you'll see an option to create the keys.

When you click "Create DKIM keys," Microsoft instantly generates the two unique CNAME records you need. This is the moment of truth. A pop-up will appear with the exact hostnames and values. Do not close this window until you've copied them somewhere safe.

The portal will give you two records, and this is a crucial detail. Microsoft uses a double-key system for better security and seamless key rotation. You must create both records in your DNS for the setup to work correctly.

The PowerShell Method for Power Users

For anyone who prefers a terminal over a GUI, PowerShell offers a direct and fast alternative. It’s especially handy if you're managing several domains at once and want to script the process. You'll need to connect to Exchange Online PowerShell first.

Once connected, you’ll use a simple command to pull the same information. The main command here is Get-DkimSigningConfig.

For instance, to get the selectors for your domain, you would run:
Get-DkimSigningConfig -Identity yourcompany.com | Format-List Selector1CNAME, Selector2CNAME

This command directly asks Microsoft for the two CNAME values for yourcompany.com. The output gives you the exact "points to" or "target" addresses for your DNS records. It’s clean, quick, and saves you from clicking through menus. This is essential for Office 365 setups with custom domains, which you can explore in more detail when managing complex email rules.

Demystifying Selectors and CNAMEs

So, what exactly did Microsoft just hand you? You’ll have two sets of values that look something like this:

  • Selector 1 Hostname: selector1._domainkey

  • Selector 1 Value: selector1-yourcompany-com._domainkey.yourtenant.onmicrosoft.com

  • Selector 2 Hostname: selector2._domainkey

  • Selector 2 Value: selector2-yourcompany-com._domainkey.yourtenant.onmicrosoft.com

Let's break that down. A DKIM selector is like a unique name for a specific key. It tells the receiving email server which public key to look for in your DNS to verify the email's signature. Think of it as having two different keys to your house, key1 and key2.

Office 365 uses two selectors (selector1 and selector2) for a very smart reason: automated key rotation. Microsoft can silently update the cryptographic keys for one selector while your emails continue to be signed with the other. This process ensures there's no downtime or delivery failures, and it's a security best practice that happens entirely behind the scenes once you set up these CNAMEs.

Your job isn't to be a cryptographer; it's simply to copy and paste these records correctly. The "Hostname" is what you'll enter into the "Name" or "Host" field at your DNS provider, and the "Value" goes into the "Target" or "Points to" field.

Before moving on, triple-check that you've copied these values exactly. A single typo is the number one reason a DKIM setup fails. Once you have these records in hand, you're ready for the most technical—but now very straightforward—part of the process: adding them to your DNS.

But first, grab a coffee. You’ve got the keys.

Now that you have them, what’s next? The logical step is publishing them. But before you do, I recommend running one last spam test at MailGenius.com to get a final "before" score. It's incredibly motivating to see your deliverability score jump after you get this right.

How to Publish Your DKIM CNAME Records

Alright, you've got your DKIM keys from Microsoft Defender. Now for the part where the rubber meets the road: publishing them to your domain's DNS. This is where you're essentially telling the world that you've given Microsoft permission to send emails for you.

Honestly, this is the step where most people trip up, but it's really just a careful copy-and-paste job. Don't worry. I’ll walk you through it with exact examples for popular providers like GoDaddy, Cloudflare, and Namecheap. Getting this right is the secret to a successful DKIM setup.

This quick flowchart breaks down the whole process, showing how you get from the Defender portal to the CNAME records your DNS provider needs.

Flowchart illustrating the DKIM key generation process, showing steps from Defender Portal to CNAMEs.

It really is that simple: generate the keys in your security portal, and you get the exact values to publish.

Decoding the CNAME Record Fields

No matter which DNS provider you're with, the interface will ask for the same basic info. The field names might change a bit, but the data you need to enter is identical. You'll be creating two CNAME records in total—one for selector1 and another for selector2.

Here’s a breakdown of what you'll be entering:

  • Type: You'll always choose CNAME. This stands for "Canonical Name," and it just creates an alias, pointing one name to another.
  • Host (or Name): This is where the first part of the selector record goes, like selector1._domainkey.
  • Value (or Target / Points to): This is that long string Microsoft gave you. It will look something like selector1-yourcompany-com._domainkey.yourtenant.onmicrosoft.com.
  • TTL (Time To Live): This tells DNS servers how long they should cache the record. Setting this to 3600 (which is one hour) is a safe and common choice.

Based on my experience, the single biggest mistake happens in the 'Host' field. Most DNS providers automatically add your domain name (yourcompany.com) to whatever you enter. Because of this, you only need to input selector1._domainkeynot the full selector1._domainkey.yourcompany.com. If you add your domain, you'll create a broken record like selector1._domainkey.yourcompany.com.yourcompany.com.

Provider-Specific Examples

Let's see what this looks like on a few of the big platforms. Remember, you have to do this twice: once for selector1 and again for selector2.

Example for GoDaddy:

  • Type: CNAME
  • Name: selector1._domainkey
  • Value: selector1-yourcompany-com._domainkey.yourtenant.onmicrosoft.com
  • TTL: 1 Hour

Example for Cloudflare (proxy OFF):

  • Type: CNAME
  • Name: selector1._domainkey
  • Target: selector1-yourcompany-com._domainkey.yourtenant.onmicrosoft.com
  • TTL: Auto (typically 1 hour)
  • Proxy status: This is critical. It must be set to DNS Only (the gray cloud). If you leave the orange cloud proxy on, it will break DKIM authentication.

Example for Namecheap:

  • Type: CNAME Record
  • Host: selector1._domainkey
  • Value: selector1-yourcompany-com._domainkey.yourtenant.onmicrosoft.com
  • TTL: 3600

See? The core information is exactly the same everywhere. The only thing that changes is what your provider calls the input fields.

Common Errors to Watch For

Precision is everything here. A single typo or extra space will cause the whole thing to fail. Here are the slip-ups I see every single day:

  • Copying Extra Characters: Be extra careful when you copy the CNAME values from the Defender portal. It's incredibly easy to accidentally grab a leading or trailing space.
  • Wrong Record Type: You absolutely must use a CNAME record. A TXT record or any other type simply won't work for Office 365 DKIM.
  • Forgetting the Second Selector: Microsoft relies on two selectors for key rotation and security. You have to create both CNAME records (selector1 and selector2) for DKIM to work properly.
  • Cloudflare Proxy is On: I can't stress this enough. If you use Cloudflare, you must disable the proxy for your DKIM records. Click the orange cloud so it turns gray. The proxy service gets in the way of the DNS query needed for verification.

Once you’ve carefully added both CNAME records and double-checked them for typos, your job is done. The next step is just waiting for these changes to make their way across the internet.

Before moving on, now is the perfect time to run a quick test. Send an email from your domain to the free tool on the MailGenius.com homepage. It will probably show that DKIM is failing. Don't panic! This is our "before" picture. After we enable DKIM in the next step and give the DNS time to update, we'll run it again to see that beautiful "pass" result.

Enabling and Verifying Your DKIM Setup

You’ve done the heavy lifting by getting those CNAME records published. Now for the satisfying part: flipping the switch in Office 365 and, more importantly, proving that your hard work actually paid off. This is where we activate DKIM signing and get tangible proof that it’s working.

Getting this part right is what separates a successful setup from a frustrating one. We aren't just going to enable it and hope for the best. I’ll show you exactly how to get immediate validation that you’ve nailed it.

Activating DKIM Signing in Microsoft 365

With your CNAME records out there on the internet, it's time to tell Microsoft to start using them. You can do this right back where we started, in the Microsoft 365 Defender portal.

Just head back to the DKIM page and follow these quick steps:

  • Navigate back to Email & collaboration > Policies & rules > Threat policies > DKIM.
  • Select the domain you just configured.
  • You should now see a toggle to enable DKIM. Flip it to Enabled.

If you're more comfortable in the command line, a single PowerShell command gets it done. Once you're connected to Exchange Online PowerShell, just run this:
Enable-DkimSigning -Identity yourdomain.com

Make sure to replace yourdomain.com with your actual domain, and you're good to go. Microsoft will now look for the CNAME records you published. Once it finds them, it will start signing your outbound emails with a DKIM signature.

The name of the game now is patience. DNS changes aren't instant; they need to propagate across the internet. While Microsoft sometimes finds the records in minutes, it can take up to an hour or even longer. Don't panic if it doesn't work right away.

The Most Important Step: Proving It Works

Waiting for DNS to do its thing can be nerve-wracking. But you don't have to just sit there and hope. The best way to get instant, definitive proof is to run a real-world test. This is where you see the payoff.

The single most important action you can take right now is to send a test email to the free tool on the MailGenius.com homepage.

Just open your Outlook, compose a new email from the domain you configured, and fire it off to the unique test address provided on the site.

In a few seconds, MailGenius will give you a detailed report. Scroll down to the authentication section. You are looking for one thing: a beautiful green checkmark next to DKIM with a "Pass" result. This is your undeniable proof that everything is configured correctly, and you've instantly improved your sender reputation.

Getting that "Pass" confirms:

  • Your CNAME records were published correctly.
  • DNS has propagated successfully.
  • Microsoft is now correctly signing your emails.

This isn't just a technical check; it’s a direct look at how mailbox providers like Gmail and Outlook see your emails. A passing DKIM score is a massive trust signal that helps your messages avoid the spam folder.

Looking Under the Hood Yourself

For those who like to see the machinery behind the scenes, you can also verify the DKIM signature by looking at the email headers yourself. After sending your test to MailGenius, you can also send one to a Gmail or Outlook account you own.

Open the email, find the option to "Show original" or "View message source," and look for a section called Authentication-Results.

You’re searching for one specific entry: dkim=pass.

Seeing this in the header confirms the receiving server successfully validated your DKIM signature. It’s a more technical way of seeing what MailGenius shows you in a clean, easy-to-read format. You can also use a dedicated DKIM checker tool to get a focused analysis of just the signature itself.

Once you have that dkim=pass result, you've officially completed the process to set up DKIM for Office 365. Your emails are now more secure, more trustworthy, and far more likely to land in the inbox where they belong.

DKIM for Office 365: Your Questions Answered

When you're knee-deep in a DKIM setup for Office 365, a few questions always seem to pop up. I get these all the time from clients, so let's walk through the common ones and clear up any confusion holding you back.

Do I Set Up DKIM for Each Custom Domain?

Yes, you absolutely do. DKIM needs to be configured individually for every single custom domain you use to send email from your Microsoft 365 tenant.

Think of it this way: if your business sends mail from yourcompany.com, yourproduct.com, and even a subdomain like marketing.yourcompany.com, each one needs its own unique DKIM setup. The process is the same for all of them, but it isn't a one-and-done deal.

For each domain, you'll need to head back into the Defender portal, generate a fresh set of selector1 and selector2 CNAME records, and add them to that specific domain's DNS. If you skip this, those other domains are left unprotected, and their emails will fail authentication checks, making them prime candidates for the spam folder.

My DKIM Test Failed. What Went Wrong?

Okay, so you ran a test and it came back with a DKIM failure. Don't panic. In my experience, this is almost always a simple fix.

Here’s the troubleshooting checklist I run through first:

  1. Hunt for Typos: A tiny copy-paste error is the number one offender. Seriously. Go back to your DNS provider's dashboard and meticulously compare the CNAME records you entered against what Microsoft provided. Look for extra spaces, missing characters, or any other small mistake in the host or target values.

  2. Give It More Time: DNS changes aren't instant. While some providers are incredibly fast, propagation can sometimes take an hour or more to fully update across the internet's network. Grab a coffee, step away for 30-60 minutes, and then try running your test again.

  3. Confirm You Flipped the Switch: This is a classic two-step process, and it's easy to forget the second part. After you've added the DNS records and they've had time to propagate, you have to go back into the Defender portal and actually toggle DKIM to "Enabled" for that domain. It won't work until you do.

What Is DKIM Key Rotation and Do I Need to Do It?

DKIM key rotation is a security best practice. It involves periodically changing out the cryptographic keys that sign your emails. This is done to limit the damage if a key were ever compromised, shrinking the window of time an attacker could exploit it.

The great news? When you set up DKIM for Office 365 using the CNAME method we've covered, Microsoft handles key rotation for you automatically. Your CNAME records point to their system, and they manage the underlying private keys and rotate them behind the scenes with zero work on your end.

This is a massive perk of using Microsoft’s integrated system. It automates a critical security task that would otherwise be a manual, recurring headache.

What Should I Do After Setting Up DKIM?

Excellent question. Getting DKIM in place is a huge win, but it's just one piece of the email authentication puzzle. Your very next move should be to set up DMARC.

DMARC (Domain-based Message Authentication, Reporting, and Conformance) acts like a rulebook. It tells receiving mail servers what to do with emails claiming to be from you that fail either SPF or DKIM checks. You can instruct them to monitor, quarantine (send to spam), or reject the suspicious message entirely.

The best way to start is with a simple "p=none" policy. This puts DMARC in a monitoring-only mode, so it won't affect your email delivery at all. Instead, it will start sending you reports on who is sending email from your domain—both legitimate and fraudulent. Once you have DKIM and SPF passing, implementing DMARC is the final step to full authentication. Learning how to check if emails are going to spam becomes much simpler once all three are working together.

Free Email Spam Test:

Will your Email Land in the Spam Folder?

Send an email to the address below to see your Spam Score:
loading...
MailGenius users test over 1M emails per year! By using our Email Tester, you will agree to our Privacy Policy and Terms of Service. The sending email address will receive emails from MailGenius. All tests are hosted on public links.

Try MailGenius Today

Run a Free Email Deliverability Test - Send an Email to the Address Below, then Click “See Your Score”:

Free Email Spam Test:

Will your Email Land in the Spam Folder?

Send an email to the address below to see your Spam Score:
loading...
MailGenius users test over 1M emails per year! By using our Email Tester, you will agree to our Privacy Policy and Terms of Service. The sending email address will receive emails from MailGenius. All tests are hosted on public links.

Try MailGenius Today