Domain email on Google Workspace or another server (cPanel)

The website can run on the hosting while the domain email lives in Google Workspace, Microsoft 365 or another mail service. Two steps are needed: change the MX records and tell cPanel that mail for the domain is handled elsewhere.

If you skip the second step, mail from the site (forms, orders) to addresses on your domain never reaches Google: cPanel delivers it to local mailboxes on the hosting.

1. MX records

Get the MX records from your mail service. For Google Workspace it is one record: smtp.google.com with priority 1. For Microsoft 365 - an address like example-com.mail.protection.outlook.com from the Microsoft admin center.

  1. Open "Zone Editor" (group "Domains") and click "Manage" for the domain.
  2. Turn on the "MX" filter.
  3. Delete the old MX record pointing to your domain and click "Add Record" to add the service MX with its priority.
Domain MX records in the Zone Editor
Domain MX records in the Zone Editor

If the domain DNS is not on the hosting (registrar, Cloudflare), change the MX there - step 2 is still required.

2. Email Routing

  1. Open "Email Routing" (group "Email").
  2. Select the domain.
  3. Choose "Remote Mail Exchanger".
  4. Click "Change".
Domain email handled by a remote server
Domain email handled by a remote server

"Automatically Detect Configuration" usually works after the MX change too, but choosing the option explicitly is more reliable.

3. SPF

To keep mail from the site and from Google out of spam, the SPF record must list both senders - for example, v=spf1 +a +mx +ip4:... include:_spf.google.com ~all. How to edit it - SPF, DKIM and DMARC.

After the switch, cPanel mailboxes of this domain are no longer needed: mail stops arriving in them.

Questions and answers
"Email Routing" is set to local - cPanel delivers to mailboxes on the hosting. Choose "Remote Mail Exchanger".
One record smtp.google.com with priority 1.