One MX to Rule Them All

Before I start I would like to call out that I think this is the best blog title that I have come up with to date. Surprisingly, or maybe not, I thought of this title and article while I was playing Ultimate Frisbee. My mind was obviously not in the game, and we did lose… anyways, let’s move on and figure out what I’m talking about with the title.

When your domains are added to Office 365 you will be presented with the MX record that will need to be set for them in DNS. Each domain will be given a slightly different and unique MX record. For example, if we added to our tenant, Office 365 would probably (but not necessarily) give us the following MX record to add to the DNS for this domain.

Now let’s consider the situation where a lot of domains have been added to Office 365. Again, each of these domains will have been given a unique MX record by Office 365. You can get these unique records either one at a time through the Office 365 Portal, or you can pull them all at once using PowerShell. Once you have obtained all the unique MX records, you then will need to set each in DNS and hope you don’t make a typo.

To make things easier, you can use a single MX record for every single one of the domains that you have added to your Office 365 tenant! Great!!

Now, what is this one MX to rule them all? It can actually be the MX that is provided for any one of your domains. Continuing on with my above example, I have my Office 365 tenant and I have added both and Office 365 has indicated that the MX for should be set to the following.

I can use this MX record for, even though Office 365 will have provided this domain its own unique MX record. Any additional domains I add to my tenant can also be configured with this same MX record.

The important part is that you are using a single Office 365 tenant. The MX record that you obtain needs to be from a domain that in in the same Office 365 tenant as all the other domains that will use this same MX.


In the above example, if you ever remove from your tenant, the MX record will stop working. So, if you want to use one MX for all your domains, use the MX from a domain that you will never delete from your tenant. Or better yet, use the MX from your default <InsertName> domain.

With the example above, the default domain was Perform an MX lookup on this and it currently returns the following.

This FQDN,, can be used as the MX record for every domain that is added to this Office 365 tenant. If this tenant also has an on-premises mail environment that is smart hosting outbound mail to EOP, this same FQDN can be used as the smart host.

Comments (9)

  1. That’s correct. Going with the recommendation above, perform an MX lookup on your domain. For example, for this returns Now, for all of the domains that are added to this example
    tenant, can be set for each of their MX records.

  2. Me says:

    how do you technically do this?
    you just change the mx for each domain to be that one that you want ?

  3. How du you pull all the MX records at once with powershell?

  4. Ed says:

    But won’t this method cause a failed RDNS lookup by a sending system for the other, not-the-same-name domains?

  5. Rodney Rutherford says:

    It appears that Outlook offer no additional MX hosts beyond the primary (i.e., no secondary, etc). Why not?

    1. Hi Rodney, I’m not sure I understand your question. The Outlook client itself does not look up the MX records, that is done by the mail server.

  6. wayne ash says:

    does the method of using the for the mx domain still work? attempted that but received bounce back

    # #SMTP#

    1. Hi Wayne, as far as I know that should still work. If you have a user that has been provisioned with the domain, they would not be able to get mail if this did not work.