< All Topics

How to change DNS records in cPanel so all emails go through Microsoft 365 Exchange Online

This is step 7 of our complete guide on how to migrate your emails to Microsoft Exchange Online. In this step we will be making changes to how your emails get routed. Instead of emails going via your current IMAP system (Bluehost, NameCheap, Hostinger) they will be routed through Microsoft Exchange Online.

During the updating of the DNS records there is a very, very small risk that someone might send you an email and it gets lost. But this is very rare. But if this is of concern to you then you can always do the switchover at a time of day when you don't usually get important emails (eg. early morning or late evening).

Tell any other users that they won't be able to send or receive emails.

1. Go to Microsoft 365 Admin Center page.

2. Go to Settings and then Domains and next to your domain it should say Incomplete setup.

3. Click on your Domain.

4. Click Continue setup.

 

DNS switchover - Step 1
DNS switchover - Step 2

Back in Step 3 we had to add a TXT record to the DNS records to prove to Microsoft you owned your domain. We now have to add 3 new DNS records to enable the routing of your emails into Microsoft 365 Exchange online. The 3 records we have to add are:

  • MX record
  • CNAME record
  • TXT Record

Microsoft give details of what the records are.

DNS switchover - Step 3
DNS switchover - Step 4

5. Login to your web hosting account / domain registrar account and go to the cPanel, just like we did back in Step 2 when we added a TXT record.

6. Go to DNS settings.

Before we can add the new records we need to delete the existing MX and CNAME records but before doing so it is recommended that you make a backup of these existing records. You can copy the values into a Word document as well as a take a screenshot.

After you have deleted the records you can add the new ones.

 

 

 

cPanel 9
cPanel 10
cPanel 11

Click Add record and select MX record.

Copy the values from the Microsoft 365 page into the cPanel.

  • Name: your domain.
  • TTL: 3600
  • Type: MX
  • Priority: 0
  • Destination: yourdomain.mail.protection.outlook.com

Click Save.

Click Add Record and choose CNAME

  • Name: your domain.
  • TTL: 3600
  • Type: CNAME
  • Destination: autodiscover.outlook.com

Click Save.

Click Add Record and choose TXT

  • Name: your domain.
  • TTL: 3600
  • Type: TXT
  • Destination: v=spf1 include:spf.protection.outlook.com -all

Click Save.

Once these 3 records have been added go back to Microsoft 365 Admin center and click Continue. 

If successful then great! All your new emails will going via Microsoft 365 Exchange Online. If it says there is an error then it is usually due to DNS server not having updated and on this basis wait 15-30 minutes and try again.

Sometimes it can take 24 hours for all the DNS servers to update so don't worry if it keeps failing. It all depends on the hosting company. Some companies seem to be faster than others.

 

cPanel 12
cPanel 13

8. Double check the DNS records have all been entered correctly.

9. Once DNS records have been added go back to Microsoft 365 and click Continue

If successful then great. If not, then leave it for about 30 minutes to 1 hour and try again. It is just a case of having to wait for the DNS records around the world to update. Sometimes it can take 24 hours for all the DNS servers to update so don't worry if it keeps failing. It all depends on the hosting company. Some companies seem to be faster than others.

 

If successful then you can there are two things to do:

  • Open webmail Outlook and send a test email
  • Check global DNS servers to make sure they all show new Microsot 365 Exchange settings.

Open Webmail Outlook

Open the Outlook webmail like we did at the end of step 5.
Go to Microsoft 365 Admin center and click on grid of dots in top left corner and select Outlook.

Send a new meail. Perhaps send an email to your personal Gmail or Hotmail account. Does it work? If so, send a reply. Does it arrive in the new inbox?

If so, then fantastic. If not then it's usually just a case of having to wait a bit longer for all those DNS records to update.

If the reply email goes into your 'old' email system - ie IMAP then just wait and try again. This is a DNS issue which will get resolved soon.

Check Global DNS Servers

Once the test emails are working we want to manually check the DNS servers around the world and ensure they are pointing to the correct DNS records. It can take up to 24 hours for all DNS servers around the world to update to the correct values.

11. Go to https://dnschecker.org/

12. Enter your domain

13. Change dropdown to MX

14. Click Search

All DNS serves should match the DNS record you added earlier.

DNS switchover - Step 6

You have now successfully setup Microsoft Exchange Online so all new emails and outgoing emails will be going via Microsoft Exchange Online.

The next step is to finish migrating emails from your old IMAP system into Microsoft Exchange Online. We do this in MingrationWiz.