This article explains how to configure DNS settings in cPanel so a domain can use Google Workspace for email and collaboration services. The process replaces local mail handling with Google mail servers.
Prerequisites and warnings
- You must have an active Google Workspace subscription for the domain.
- DNS changes affect email delivery for the domain.
- After switching MX records, email accounts are managed in Google Workspace, not in cPanel.
These steps apply to standard cPanel hosting environments.
Étape 1: Create and verify a Google Workspace account
- Create a Google Workspace account for the domain.
- Access the Google Workspace admin console.
- Complete domain verification using one of the supported verification methods.
Google services remain inactive until domain verification is completed.
Étape 2: Remove existing MX records
- Connectez-vous à cPanel.
- Ouvrez le Outils page.
- Dans le Domaines section, faire un clic Zone Editor.
- Locate the domain and click Manage.
- Identify all existing Mx records.
- Delete each existing MX record.
[Screenshot placeholder: Zone Editor showing existing MX records]
Save the current DNS configuration before deleting records so it can be restored later if needed.
Étape 3: Add Google Workspace MX records
Primary MX record
- Dans Zone Editor, faire un clic Add MX Record.
- Set the zone name to the domain.
- Confirm TTL is set to 14400.
- Set Priorité à 1.
- Set Destination based on signup date:
- Accounts created before April 2023:
aspmx.l.google.com - Accounts created after April 2023:
smtp.google.com
- Accounts created before April 2023:
- Save the record.
Additional MX records for older accounts
If the account was created before April 2023, add the following records:
- Priorité 5, Destination
alt1.aspmx.l.google.com - Priorité 5, Destination
alt2.aspmx.l.google.com - Priorité 10, Destination
alt3.aspmx.l.google.com - Priorité 10, Destination
alt4.aspmx.l.google.com
[Screenshot placeholder: Google Workspace MX records added]
Étape 4: Update the SPF record
- Dans Zone Editor, locate existing SMS records starting with
v=spf. - Delete the existing SPF record.
- Add a new SMS record with the following value:
v=spf1 include:_spf.google.com ~all
- Save the record.
[Screenshot placeholder: SPF TXT record configuration]
Étape 5: Set email routing to remote
- Ouvrez le Outils page in cPanel.
- Dans le E-mail section, faire un clic Email Routing.
- Select the domain.
- Choisir Remote Mail Exchanger.
- Faire un clic Change.
[Screenshot placeholder: Email Routing set to Remote Mail Exchanger]
DNS propagation can take up to 24 heures. Email delivery begins once propagation is complete.
Reverting back to cPanel email
To stop using Google Workspace:
- Remove the Google Workspace MX records.
- Restore the previous MX records.
- Restore the previous SPF record.
- Change email routing back to Local Mail Exchanger.
After reverting, email accounts are managed again through cPanel.
Deliverability considerations
When routing email through external providers, proper DNS alignment is critical. For additional filtering and reputation control, services such as SpamExperts can improve mail reliability. Domains with multiple services or advanced routing requirements may benefit from infrastructure like serveurs cloud.