Home
Back to insights

How to Configure DKIM in Microsoft 365 Securely

7 min read
How to Configure DKIM in Microsoft 365 Securely

A message can pass Microsoft 365 filtering and still be treated with suspicion by a recipient system if its domain cannot prove that it authorised the content. That is the practical reason to configure DKIM in Microsoft 365: it gives receiving mail systems a cryptographic way to verify that an email sent in your organisation's name has not been altered in transit.

For UK organisations managing phishing risk, DKIM is not simply a deliverability setting. It is a core email-authentication control that supports domain trust, improves the usefulness of DMARC, and makes it harder for criminals to impersonate your domain. It should sit alongside SPF, DMARC, Microsoft 365 protection, employee reporting and a disciplined phishing triage process.

What DKIM does in Microsoft 365

DomainKeys Identified Mail, or DKIM, adds a digital signature to outbound messages. Microsoft 365 signs selected headers and the message body using a private key. The recipient retrieves the corresponding public key from DNS and checks whether the signature is valid.

A valid DKIM result confirms two useful things: the message was signed by a system authorised for the domain, and protected parts of the message have not changed after signing. It does not establish that the sender is trustworthy, nor does it stop a compromised mailbox sending malicious content. Those distinctions matter when investigating a reported email.

DKIM is most effective when it aligns with the visible From domain used by staff, applications and communications teams. That alignment is what allows DMARC to make a meaningful decision about messages that claim to come from your organisation.

Before you configure DKIM in Microsoft 365

Start with an accurate view of every domain that sends email. This includes the primary corporate domain, acquired brands, regional domains and any domain used by an external marketing, CRM, recruitment or finance platform. Microsoft 365 DKIM only covers mail it sends. A third-party sender must be configured separately through that supplier's signing arrangement.

You also need access to the DNS zone for each custom domain. In many organisations, Microsoft 365 administration and DNS management sit with different teams or providers. Treat the change as a controlled security task: agree the owner, the requested records, the change window and how successful publication will be checked.

Check that SPF is already in place and contains only legitimate sending services. SPF has a practical DNS lookup limit, so adding services without reviewing the existing record can create its own authentication failures. If DMARC is already enforcing quarantine or reject, be particularly careful with domains that use multiple senders. DKIM configuration is usually low risk, but poor sender inventory can expose a previously unnoticed dependency.

Microsoft 365 provides DKIM signing by default for its initial onmicrosoft.com domain. For custom domains, administrators must publish the required DNS records and then enable signing. Do not assume that a passing DKIM result for the initial tenant domain means your public-facing domain is protected.

How to configure DKIM in Microsoft 365

1. Generate the required CNAME records

In the Microsoft Defender portal, open the DKIM settings within the email authentication or threat policy area. Select the custom domain you want to configure. Microsoft 365 will display two CNAME records, normally based on the selectors `selector1` and `selector2`.

The records usually follow this pattern:

`selector1._domainkey.yourdomain.co.uk` points to `selector1-yourdomain-co-uk._domainkey.yourtenant.onmicrosoft.com`

`selector2._domainkey.yourdomain.co.uk` points to `selector2-yourdomain-co-uk._domainkey.yourtenant.onmicrosoft.com`

Use the exact values shown in your tenant. The destination includes your Microsoft 365 initial domain, and Microsoft generates it to match your configuration. Copying an example from another tenant is a common source of failure.

The two selectors support key rotation. Microsoft can move from one signing key to another without requiring a disruptive replacement of the public key at the exact point of change. Both records should therefore be published before DKIM is enabled.

2. Publish the records in public DNS

Create both CNAME records with your DNS host. Some DNS management interfaces automatically append the zone name to record values, while others require the fully qualified name. Check how your provider handles this before saving the records. A duplicated domain suffix can leave the CNAME looking plausible in the portal but unavailable to recipients.

Avoid creating TXT records in place of CNAME records. Microsoft 365 expects the DKIM selectors to resolve through the CNAME targets it supplies. Also avoid deleting pre-existing selector records until you have confirmed they are no longer used by another legitimate sending platform.

DNS propagation may take minutes or several hours, depending on the provider and TTL settings. The Defender portal will not allow signing to be enabled until it can resolve the required records. If it cannot, check spelling, the tenant name in the target, the selected domain and whether DNS changes have reached authoritative name servers.

3. Enable DKIM signing

Once both CNAME records resolve correctly, return to the domain's DKIM settings and enable signing. Microsoft 365 will begin applying DKIM signatures to eligible outbound messages sent using that custom domain.

The administrative action is straightforward, but the operational check should not stop there. Send a message from a mailbox using the domain to an external test mailbox and inspect the authentication results in the received headers. Look for a result such as `dkim=pass` and confirm that the `d=` value is the domain used in the visible From address, or an aligned organisational domain where your DMARC policy permits it.

4. Validate DMARC alignment

DKIM passing alone is useful, but DMARC passes when either SPF or DKIM both passes and aligns with the From domain. For most organisations, DKIM should provide the more durable alignment path because SPF can fail when legitimate mail is forwarded.

Review DMARC aggregate reports after enabling DKIM. They show which sources are sending as your domain and whether each source passes SPF and DKIM. This evidence helps identify forgotten SaaS platforms, unauthorised senders and services using a different domain than expected. It also gives security teams a firmer basis for moving a DMARC policy from monitoring to quarantine or reject.

Common implementation problems

The most frequent issue is enabling DKIM for only the principal corporate domain while finance, HR or marketing send from separate domains. Attackers routinely select the less well-governed domain for impersonation, particularly where it appears credible to suppliers or employees.

Another issue is treating outbound applications as part of Microsoft 365 because staff use Microsoft 365 mailboxes. A payroll system, ticketing tool or bulk mailing supplier may send directly from its own infrastructure. Its messages will not automatically receive a Microsoft 365 DKIM signature. Confirm how each platform signs mail and whether its signing domain aligns with the From address.

Message modification can also affect results. Mailing lists, secure email gateways and forwarding services sometimes alter content after a message is signed. Modern implementations usually handle this well, but authentication failures following a routing change deserve investigation rather than assumption. Compare the original sending path, the final headers and the relevant DMARC report data.

Finally, do not overlook DNS governance. An expired DNS contract, an unmanaged registrar account or overly broad access to DNS administration creates a direct risk to email authentication. Changes to DKIM, SPF and DMARC should be logged, reviewed and included in incident-response procedures.

DKIM is one control in the phishing response lifecycle

DKIM reduces an attacker's ability to use your domain convincingly, but it does not prevent lookalike domains, supplier compromise or business email compromise from trusted accounts. Recipients can still receive well-crafted phishing messages that pass authentication.

That is why an effective control set combines domain authentication with human reporting, phishing triage and remediation. When users report suspicious messages from Outlook, analysts need enough context to assess headers, sender behaviour, URLs and attachment indicators quickly. Confirmed threats should then be removed from relevant mailboxes and used to improve detection rules, user guidance and threat intelligence.

Wise Fish works with organisations that need this operational connection between Microsoft 365 protection and the people who receive and report suspicious email. The aim is not merely to achieve a passing authentication result, but to make email risk measurable and manageable.

Treat DKIM as a maintained control rather than a one-off DNS task. Review it whenever you introduce a new sender, change domains, migrate a business unit or investigate an impersonation incident. That discipline keeps your authentication posture aligned with the way your organisation actually communicates.

How quickly could your team contain the next report?

Assess your reporting, triage and remediation steps against a practical maturity model, and see where the workflow breaks down.

Take the phishing protection assessment

Share this article

How to Configure DKIM in Microsoft 365 Securely

We use cookies to analyse site usage and improve your experience. By continuing, you agree to our Privacy Policy and Cookie Policy. We never sell your data.