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

- 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.
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.
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.
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.
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.
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.
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.
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.

Review hybrid mail flow and DMARC enforcement
Use this check when inbound mail reaches an on-premises server before Exchange Online Protection or outbound mail uses multiple routes.
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.

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.




