Security Policy Errors

Configure DKIM and DMARC for Microsoft 365 Hybrid Exchange

Algirdas JasaitisAlgirdas Jasaitis Nov 25, 2026 868 views

Question details

Configure DKIM and DMARC for custom domains used in a hybrid Exchange and Microsoft 365 environment.

Configure DKIM and DMARC for Microsoft 365 Hybrid Exchange
Product
Microsoft 365 Exchange Online and Exchange Online Protection
Device & OS
not provided
Scenario
An organization sends and receives mail through a combination of on-premises Exchange and Microsoft 365.
Observed behavior
Custom-domain mail should be authenticated with DKIM and evaluated against an appropriate DMARC policy, taking hybrid mail routing into account.
Before you start

Identify every domain and subdomain used in the visible From address, and confirm that you can edit their public DNS records. Review the inbound and outbound mail paths, including any on-premises servers, connectors, and services that modify messages.

Solution 1Recommended

Publish DKIM and DMARC records for sending domains

Use Microsoft-provided DKIM records and a monitoring-first DMARC policy for custom domains that send mail.

1
Find the DKIM records

In the Microsoft Defender portal, open Email & collaboration > Policies & rules > Threat policies > Email authentication settings > DKIM. Select a custom domain and copy the two CNAME records shown for it.

2
Publish the CNAME records

In your public DNS provider's management console, add the two CNAME records exactly as Microsoft provides them. Repeat for each custom sending domain that uses Exchange Online for DKIM signing.

3
Enable DKIM signing

After the DNS records have propagated, return to the domain's DKIM settings in the Microsoft Defender portal and enable signing. Microsoft handles DKIM for the initial onmicrosoft.com domain.

4
Add a DMARC record

In public DNS, add a TXT record at _dmarc for each sending domain as appropriate. For initial monitoring, use a value such as v=DMARC1; p=none; rua=mailto:dmarc@example.com, replacing the address with a mailbox that can receive DMARC reports.

5
Review reports and test mail

Send test messages through each outbound mail path, then inspect the Authentication-Results headers and DMARC reports. Once legitimate sources pass aligned SPF or DKIM, consider changing the DMARC policy to quarantine or reject.

Publish DKIM and DMARC records for sending domains
Check DMARC alignment: DMARC passes when either SPF or DKIM passes and aligns with the domain in the visible From address. A DKIM signature alone does not guarantee DMARC alignment.
Free Microsoft Office alternative

Manage your mail authentication documentation with WPS Office

WPS Office is a free, lightweight Office alternative with a familiar interface and Microsoft Office format compatibility, making it easy to move existing DNS inventories and configuration documents. DKIM and DMARC configuration still requires Microsoft 365 and your DNS provider.

Document sending domains, DNS records, and mail-flow checks in spreadsheetsOpen and edit Microsoft Excel XLSX and Word DOCX filesUse a familiar interface for a smoother move from Microsoft OfficeWork with a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Where do I find the DKIM CNAME records for my domain?

In the Microsoft Defender portal, go to Email & collaboration > Policies & rules > Threat policies > Email authentication settings > DKIM. Select the custom domain to see the records Microsoft provides.

Do I need to configure DKIM for the onmicrosoft.com domain?

Microsoft handles DKIM for the initial onmicrosoft.com domain. For a custom domain, publish the Microsoft-provided CNAME records and enable signing in its DKIM settings.

What DMARC policy should I use first?

A p=none policy lets you monitor authentication results without requesting quarantine or rejection. Add a rua reporting address to the _dmarc TXT record, review legitimate senders, and consider enforcement after resolving alignment issues.

Does DMARC require both SPF and DKIM to pass?

No. DMARC passes if either SPF or DKIM passes and aligns with the domain in the message's visible From address.

Can an on-premises MX record affect DMARC enforcement?

Yes. If the primary MX sends mail to an on-premises server first, connector trust and filtering settings can affect where DMARC is evaluated or enforced. Review the inbound path and test messages through it.