Skip to main content

How to configure email for Gmail with Google Workspace?

Updated today

Configuration of Google Gmail in cPanel

The application that manages Gmail is Google Workspace. Some users prefer to have the website on hosting and manage the email in Workspace. This way, the email will not take up space in the hosting.

When did you register in Google Workspace?

When you started using Google Workspace, you were asked to add the 5 MX records shown in the table below.

In April 2023, the registration process in Google Workspace changed: new customers use one MX record. This change makes it easier to activate Gmail and does not affect mail delivery or reliability.

Important: If Gmail works correctly, do not change your MX records. If you do, incoming email messages might bounce.

To add MX records we go to cPanel -> Domains -> Zone editor

They must point to the following Google servers.

These are Google’s MX entries if you registered before 2023:

Nombre/Host/Alias*

Prioridad

Valor/Respuesta/Destino

Vacío o @

1

ASPMX.L.GOOGLE.COM

Vacío o @

5

ALT1.ASPMX.L.GOOGLE.COM

Vacío o @

5

ALT2.ASPMX.L.GOOGLE.COM

Vacío o @

10

ALT3.ASPMX.L.GOOGLE.COM

Vacío o @

10

ALT4.ASPMX.L.GOOGLE.COM

Note: ASPMX.L.GOOGLE.COM will be the most important record.

You must follow the following steps:

I registered in 2023 or later

Customers who subscribed to Google Workspace after April 2023 will use one MX record. In this way, new customers can activate Gmail more easily. It does not affect mail delivery or reliability.

You can use the five MX records shown in the previous section or those shown in the table below.

Important: If Gmail works correctly, do not change your MX records. If you do, incoming email messages might bounce.

Nombre/Host/Alias*

Prioridad

Valor/Respuesta/Destino

Vacío o @

1

SMTP.GOOGLE.COM

*Domain hosts use different labels for the name and value fields. Some hosts also require a period at the end of smtp.google.com.

We share in this case how to do it with the records, if you registered before 2023.

Access Zone Editor in cPanel

Log into your cPanel -> Domains -> Zone editor

Manage your account

You will see a list of the domains in cPanel; to add MX records click Manage on the right of a domain.

Perform a filter

On the next screen to filter only MX records click on MX (point 1 in the image).

Add record

Click on + Add record (point 2) to add a new MX record.

A form will appear where you must mark in Type -> MX filling the Priority and Destination fields with the previous records:

  • Priority 1 and destination ASPMX.L.GOOGLE.COM.

  • Priority 5 and destination ALT1.ASPMX.L.GOOGLE.COM

  • Priority 5 and destination ALT2.ASPMX.L.GOOGLE.COM

  • Priority 10 and destination ALT3.ASPMX.L.GOOGLE.COM

  • Priority 10 and destination ALT4.ASPMX.L.GOOGLE.COM

Example of the new MX record if you registered from April 2023:

It is important that you delete or modify the predefined MX entry you have, with destination yourdomain.com and priority 0.

Then you must go to your cPanel -> Email -> Email Routing.

We choose the domain in the dropdown and select the Remote Mail Exchanger option and save:

To modify the CNAME record access your cPanel -> Domains -> Advanced Zone Editor:

You only have to change:

mail.yourdomain.com IN CNAME yourdomain.com to mail.yourdomain IN CNAME ghs.google.com

For it to be 100% functional, this process may have an estimated propagation duration of between 2 and 4 hours. Google Gmail will then be fully operational.

You can also consult the following official Google link where the procedure is explained.


Avoid email spoofing with SPF records

We must always protect ourselves from forged emails that may come from our domain.

Spammers may send emails making it look like they come directly from our domain. This practice is called spoofing. But you should not worry about it, since we can add a Sender Policy Framework (SPF) record directly to the hosting of your domain. In this way all the recipients of the messages will know which servers are authorized to send emails directly from our domain and which emails are not classified.

Insert TXT record in our domain hosting

The hosting of our domain has some text settings, which we call DNS records, which are responsible for directing web traffic to the domain. TXT records of SPF type tell mail servers which servers have the necessary permission to send emails from our domain. As a consequence, if the server receives an email from another server not included in this record, it may consider it spam.

It is important to know that a domain can only have one SPF record, but it can include several servers.

  1. First you must log in to your domain hosting account.

  2. Go to the page where your domain’s DNS records are updated. The name of this page will appear something like DNS management, Name Server or Advanced settings.

  3. You must look for the TXT records and check if your domain has an SPF record. You can identify the records by the name «v=spf1».

  4. If your domain already has one, you must remove it.

  5. Now you have to create a TXT record with the following values:

Name/Alias/Host: put @ or leave it completely blank. It may happen that other DNS records of the domain indicate what the correct value is.

Time to Live: you can leave this value as default or enter the value 3600.

Value/Destination/Answer: In this parameter you must enter:

v=spf1 include:_spf.google.com ~all
  1. Now you can save the record.

SPF records may take at least 1 hour to apply and start.

Did this answer your question?