What is an MX Record?
MX records, or mail exchange records, are special server settings that help control the way your email is routed. In terms of DNS, an MX record tells incoming mail which server can receive it, and then directs it to that server. In other words, if your MX records are pointing to the wrong location, you won’t be able to receive emails.
Most web hosts create DNS records for their clients that default to the host’s server. If you’d like to use a different mail provider separate from your hosting account, you need to create an MX record.
*Note: changing your MX records only points newly incoming mail to your updated email server. This means that any emails already on your existing mail server will not be transferred over.
Understanding the Structure of an MX Record
MX records use two important pieces of information when directing traffic: a priority number and the domain name where the server is hosted.
The priority number determines which order a server will receive mail in and starts with the lowest available priority, starting with “0”. If two servers with the same priority level are both available, one will be chosen at random.
The second part, the domain name, is the name of the specific mail server the mail is being sent to. They typically look something like “mail.DOMAIN.com“. Some hosting providers have special instructions for setting up MX records and may also require a “.” placed at the end of the server name, such as “mail.DOMAIN.com.“.
Configuring MX Records for Gmail
As Gmail is one of the most popular email providers, for the sake of this tutorial, we’ll focus on how to create MX records using Google’s default mail servers.
Google provides users with five different mail servers, assigning each a default priority level. They are:
- ASPMX.L.GOOGLE.COM -> Priority 1
- ALT1.ASPMX.L.GOOGLE.COM -> Priority 5
- ALT2.ASPMX.L.GOOGLE.COM -> Priority 5
- ALT3.ASPMX.L.GOOGLE.COM -> Priority 10
- ALT4.ASPMX.L.GOOGLE.COM -> Priority 10
Using the default priority settings, your mail will be routed to the first available server with the lowest priority level. In most instances, this will be ASPMX.L.GOOGLE.COM, since it has a priority level of 1.
If however, the first server is unavailable for some reason, then mail will be routed to the next available server. Since both ALT1 and ALT2 carry the same priority level, it will be sent to one of them at random.
More information on Google’s mail server’s can be found on their official support page.
Now that you know what the names for Google’s servers, you can set up the MX records for them using your favorite control panel.
Changing an MX Record Using cPanel
To setup or make changes to your MX records using cPanel, follow these steps:
- First, you’ll need to log in to your cPanel account using your username and password. You can access your control panel by using https://www.YOURDOMAIN.com:2082.
- Next, in the Mail section of your dashboard, click on the icon for Modify Mail Exchanger (MX Entry).
- Click the option to Change an MX Entry.
- Select the domain from the drop-down menu.
- If you’re using Gmail, then in the section labelled Add New Record, enter the server information listed above.
- Set the priority number for each record, remembering that lower numbers have higher priority.
- In the Destination box, enter the name/domain of the new mail server. If using Gmail, start with:
repeat for the other servers on the list.
- When you’ve finished making changes to the MX record, you can click Add New Record to save your changes.
*Note: it may take upwards of 48 hours for the DNS propagation to take effect.
If should ever want to delete an MX entry using cPanel, you can do so simply by clicking the Delete button next to the applicable MX record and confirming your selection.
Changing an MX Record Using WHM (Web Host Manager)
To setup or make changes to MX records using WHM, follow these steps:
- First, log in to your WHM account using your username and password.
- On the left-hand side, locate and click on the option for DNS Functions.
- Click on Edit DNS Zone.
- From the drop-down window, select your domain and click Edit.
- If there is already an existing MX record entered, you should delete it.
- Enter your domain name and leave the second box as is.
- From the drop-down menu, select the option for MX.
- If you’re using Gmail, then enter the information for Google’s mail servers as listed above, including the trailing period. For example:
- When you’re finished editing the records, click Save.
Keep in mind, it may take a day or so for your DNS changes to be updated.
Changing an MX Record Using Plesk
To setup or change an MX record using the Plesk control panel, follow these steps:
- First, you’ll need to log in to Plesk using your username and password.
- Under the Websites & Domains tab, select DNS Settings.
- Locate the domain you are making changes to and click the option to Manage.
- Select the option to Add a Record.
- Using the drop-down menu, change Record type to MX.
- Leave the option for Mail domain blank.
- In the form field labelled Mail exchange server, enter the name of the mail server you are sending your incoming mail to. If you are using Gmail, start with the first mail server:
- Using the drop-down menu labelled Specify the priority of the mail exchange server, enter the priority number for the server as listed above. If you do not have a specific priority number for the mail server you’re using, leave it set on “0“.
- Click on Apply to save your changes and repeat for any additional MX records you need to create.
Remember that changes to DNS won’t take effect immediately.
And there you have it! You should now be able to modify an MX record for Gmail using any one of the above control panels.