Networking & DNS

MX records and Email Routing in cPanel (use Google Workspace or Microsoft 365)

Change MX records in cPanel Zone Editor, set Email Routing to local or remote, and connect Google Workspace or Microsoft 365 while keeping your website on MdmHost.

IntermediatecPanel hosting3 min read

MX records tell other mail servers where to deliver email for your domain. By default they point to your MdmHost cPanel server. If you move your mailboxes to Google Workspace or Microsoft 365, you change the MX records and tell cPanel to stop accepting mail locally. Getting both parts right prevents lost or bounced messages.

Before you start

  • Your domain uses the MdmHost nameservers (otherwise change MX at your DNS provider).
  • The MX values from your email provider's setup wizard.
  • If you already have mail in cPanel, plan how to move it, for example with an IMAP migration from the provider.

Change the MX records

  1. Open cPanel → Domains → Zone Editor and click Manage next to the domain.
  2. Click the MX filter to show only mail records.
  3. Delete or edit the existing record that points to your domain, for example example.com with priority 0.
  4. Click + Add Record, choose MX, and add the provider's values:
    ProviderPriorityDestination
    Google Workspace1smtp.google.com
    Microsoft 3650example-com.mail.protection.outlook.com (from your admin centre)
  5. Click Save Record.

A lower priority number means "try first". If the provider gives several MX records, add them all with their priorities.

Set Email Routing

cPanel decides per domain whether it is the final destination for email. If it still thinks it is local, mail sent from forms or other mailboxes on the same server will be delivered locally and never reach Google or Microsoft.

  1. Open cPanel → Email → Email Routing.
  2. Choose the domain.
  3. Select Remote Mail Exchanger and click Change.
OptionMeaning
Automatically Detect ConfigurationcPanel guesses from the MX records. Usually correct, but explicit is safer.
Local Mail ExchangerMailboxes live in this cPanel account (default).
Backup Mail ExchangerThis server only queues mail if the primary is down.
Remote Mail ExchangerMail is hosted elsewhere; cPanel always sends it out.

Update SPF and DKIM

Your SPF record must allow the new provider. Edit the TXT record that starts with v=spf1 and include, for example, include:_spf.google.com or include:spf.protection.outlook.com. Keep +a +mx or the server IP if your website still sends mail from MdmHost. Add the provider's DKIM record too. Details: SPF, DKIM and DMARC in cPanel.

Tip: Lower the MX TTL to 300 a day before the switch so mail moves to the new provider quickly.

Switching back to cPanel email

  1. In Zone Editor, delete the provider's MX records and add MX 0 example.com (or mail.example.com).
  2. In Email Routing, choose Local Mail Exchanger.
  3. Restore the default SPF in Email Deliverability → Repair.

Troubleshooting

  • Contact form emails never arrive: Email Routing is still Local. Change it to Remote.
  • "Mail delivery failed" after the move: the old MX is still cached; wait for the TTL and check with nslookup -type=MX example.com.
  • Messages land in spam: SPF still lists only the old server. See why emails go to spam.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.