Configure Exchange Hybrid Mail Flow for Multiple Domains
Question details
Configure different mail routes for an on-premises Exchange domain and an Exchange Online domain in a hybrid deployment.
- Product
- Microsoft Exchange Server and Exchange Online
- Device & OS
- not provided
- Scenario
- An organization wants on-premises mailboxes to use an on-premises Mimecast or Barracuda gateway while a separate cloud domain uses Exchange Online Protection.
- Observed behavior
- The desired configuration uses separate inbound MX records and appropriately configured outbound connectors for the two mailbox locations.
Identify which mailboxes and domains are on premises or in Exchange Online, and check the existing MX records, connectors, and hybrid mail-flow settings. Confirm the gateway's required smart host, TLS, and compliance settings with its administrator.
Configure separate inbound and outbound routes for each mailbox location
Use this approach when on-premises mailboxes must use a third-party gateway and cloud mailboxes can use Exchange Online Protection.
MX records determine where external senders deliver inbound mail for a domain; they do not control outbound mail. Outbound routing depends on the sending environment, connectors, and any applicable mail-flow rules.
Review hybrid routing before making changes. In particular, centralized mail transport can route Exchange Online outbound mail through on-premises Exchange, which may conflict with the desired cloud route.
In your DNS provider's management console, point the MX record for the on-premises domain to the approved Mimecast or Barracuda gateway. In the gateway's administration console, configure delivery to the on-premises Exchange environment.
In the Microsoft 365 admin center, add and verify the cloud domain if it is not already configured. In the DNS provider's console, set that domain's MX record to the Exchange Online Protection destination supplied for the domain.
In the on-premises Exchange admin center, open Mail flow > Send connectors and configure the appropriate Internet-bound connector to use the approved gateway as its smart host. Preserve the separate hybrid routing needed to deliver mail between on-premises Exchange and Exchange Online.
In the Exchange admin center, review Mail flow > Connectors and the hybrid configuration. If cloud mail should leave through Exchange Online Protection, ensure centralized mail transport or another outbound connector does not redirect that traffic through the on-premises gateway.
Send test messages to and from mailboxes in each location, including messages between the two environments. Check gateway logs, on-premises message tracking, and Exchange admin center message trace to confirm the actual routes.

Document your Exchange mail-flow plan with WPS Office
WPS Office is a free, lightweight alternative for documenting mail routes and maintaining configuration inventories. Its familiar interface and Microsoft Office format compatibility make it easy to move existing documents and spreadsheets. WPS Office does not configure or repair Exchange mail flow.

Frequently Asked Questions
Can two domains in an Exchange hybrid deployment use different outbound gateways?
Yes. On-premises and cloud mailboxes can use different outbound paths, but the result depends on connectors and hybrid settings. Check on-premises Send connectors and Exchange Online connectors, including whether centralized mail transport is enabled.
Does changing a domain's MX record change its outbound mail route?
No. An MX record tells external senders where to deliver inbound mail for the domain. Configure outbound routing separately through Exchange connectors, gateway settings, and any applicable mail-flow rules.
How can I check whether cloud mail is routed through on-premises Exchange?
Review centralized mail transport in the hybrid configuration and inspect Mail flow > Connectors in the Exchange admin center. Send a test message and use message trace and gateway logs to verify its route.
Can I select an on-premises send connector solely by the sender's domain?
On-premises Exchange send connectors route primarily by recipient address space, not sender domain alone. If senders in the same environment require different gateways, plan an additional routing design rather than relying on separate MX records.




