question

AlisonKing-5774 avatar image
0 Votes"
AlisonKing-5774 asked AlisonKing-5774 commented

Remove a custom domain from Exchange hybrid and Tenant

Hi, I have been asked to remove a custom domain from our Exchange Hybrid and O365 tenant.

The reason for this is that we have sold the company and they have set up their own O365 tenant and want to retain use of the domain name for their tenant.

The MX record for the custom domain is pointing to our On-prem Exchange server still, so that may make things easier for the mail flow.

I need to to be able to send/ receive using the custom domain using our on prem Exchange servers for a short while until the sold company can get the MX records/SPF records changed etc. We have forwarding in place to temporarily forward emails onto their new email addresses.

I have moved all of the objects which utilise the custom domain to a non-synched OU in AD so that O365 does not see the domain as "in use", so I theory I should be able to use the M365 Admin portal > Settings > Domains > Remove Domain
I will also need to re-run the Exchange Hybrid Configuration Wizard and deselect the custom domain.

My question is, do I have all of the steps to accomplish what I need to do listed above, and which order do I do them in?

If I remove the custom domain from the hybrid and tenant, will the on premise Exchange servers still process emails for that domain if the MX record is pointing to the on prem Exchange servers?






office-exchange-hybrid-itpro
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AndyDavid avatar image
0 Votes"
AndyDavid answered AlisonKing-5774 commented

Yes, as long as the on-prem Exchange Servers have the domain set as an accepted domain, and the mx points to the Exchange On-prem servers, then it will work.

Your steps look correct.

  1. Ensure the domain is still set as accepted on-prem with a mx record pointing to on-prem

  2. Ensure your firewall allows port 25 to your inbound gateway or Exchange directly since it wont go through 365 any longer

  3. Remove the domains in Azure/365

  4. Re-run the hybrid wizard and do not include that custom domain

  5. Ensure all External DNS records are updated once the domain is moved to 365 again ( Don't forget autodiscover.customdomain, SPF, MX, DKIM and DMARC)

Once the change is complete, remove the custom domain as accepted in Exchange and remove all the old legacy SMTP proxy addresses and UPNs on accounts or other objects that may be associated with it

When you say "forwarding in place to temporarily forward emails onto their new email addresses.". I assume you mean forwarding to another temp domain and not the custom one.



· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @AlisonKing-5774 ,
Agree with what Andy said.
You could following the steps in this article to remove the domain in Office 365.
For more information: Remove a domain



If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.




0 Votes 0 ·

Yes you are correct about the forwarding.

They have a brand new domain set up (Domain Y) and that has been added to their new tenant. They are using that new domain as their primary SMTP address for now.

I am forwarding from the custom domain (Domain X) that they want to take with them, to their new mailboxes on their new domain (Domain Y).

They want to use their old custom domain name (Domain X) in the future, so I need to hand it over to them with the least amount of disruption.

They will be adding the SMTP addresses from the custom domain ( Domain X) to their corresponding mailboxes in Domain Y, or creating new mailboxes with the old Domain X SMTP addresses when I give them the domain back.

Thanks for your helpful reply.

0 Votes 0 ·