How To Add Microsoft 365 MX Records

SkyStra
Jun 22, 2020

To configure Microsoft 365 mail on your domain, log in to your cPanel control panel. Click here for instructions on how to get to cPanel.

DNS Zone Editor

Once you’re in the cPanel control panel, click on the Zone Editor under the Domains section:

Add Microsoft 365 MX (Mail) Records

Next, click the Manage button for the domain you’d like to configure.

Now, open the following Microsoft support article in a new tab, and take note of the MX and TXT values as instructed in the article. Microsoft 365 records are different depending on your domain, make sure you get the right ones.

Once you’ve got the records, find the existing MX record in the list, and click the Edit button:

You only need to change the priority and destination fields, so input the correct values you got from the Microsoft support article.

Click the Save Record button to save the change.

Using built-in filters, you can filter MX records to ensure they’ve all been added properly: 

Add Microsoft SPF Record

Once you’ve put in the Microsoft 365 MX records, you’ll have to put in the Microsoft SPF record by doing the following.

From the main DNS zone screen, click on the Manage button next to the domain name you are editing:

Find the existing SPF record listed as a TXT from the list, it will always be the following record:

v=spf1 +a +mx +ip4: 10.1.68.1 include:relay.mailchannels.net ~all

Once you’ve found it on your DNS zone, click the Edit button next to it:

Delete the existing SPF record and replace it with the Microsoft SPF record, which is the following:

v=spf1 include:spf.protection.outlook.com -all

Click the Add Record button to save the changes.

Add Microsoft CNAME Records

Next, we need to set up the required CNAME records Microsoft provided.

Again, click the dropdown arrow next to the Add Record button, and select the Add “CNAME” Record from the dropdown: 

You only need to fill in two fields: Name & Record. 

NameRecord
autodiscoverautodiscover.outlook.com
sipsipdir.online.lync.com
lyncdiscoverwebdir.online.lync.com
enterpriseregistrationenterpriseregistration.windows.net
enterpriseenrollmententerpriseenrollment.manage.microsoft.com

It should look like this:

Make sure to add all the above CNAME records in the same manner.

Add Microsoft SRV Records

Now, we need to add two SRV records. Click the dropdown arrow next to the Add Record button, and select the Add “SRV” Record option:

Add the following two SRV records:

Record 1

Name: Your domain

TTL: Leave as is

Type: SRV

Priority: 100

Weight: 1

Port: 443

Target: sipdir.online.lync.com

Record 2

Name: Your domain

TTL: Leave as is

Type: SRV

Priority: 100

Weight: 1

Port: 5061

Target: sipfed.online.lync.com

It should look like this:

Remote Email Routing

The last step is to set up email routing so that our Cloud Instance knows it shouldn’t relay emails to local email accounts.

Go back to the cPanel home, and click the Email Routing option under the Email section:

Select your domain from the dropdown list:

Finally, select the Remote Mail Exchanger option and click the Change button to save changes:

That’s it! Now you’ve configured your domain to use Microsoft 365 email. However, please note that it can take up to 24 hours for the DNS changes to propagate globally and load across the internet.