MX, or Mail Exchange, records are used by mail servers to determine where to deliver email.
MX records must be used in conjunction with A records. The A record will point to the mail server(s). When another mail server wants to communicate with your mail server, it will look for an MX record. That MX record must point to the A record which points to the mail server’s IP address.
If an MX record is missing for the domain, then the mail for the domain will normally be attempted to be delivered to the matching A record. So for the domain “yourdomain.com” if there were no MX records for “yourdomain.com” then the mail would be attempted to be delivered to the apex/root record of “yourdomain.com”.
MX records do not support DNS Failover, however, they have a sort of failover service built-in. You’ll notice that when you create an MX record you have the option to set an MX Level for the record. The MX level determines the order (which mail server) that your mail will be attempted to be delivered. The mail server with the lowest MX level will first be attempted to have the email delivered.
So if you have three MX records with levels 10, 20, 30 the following would occur:
1. Navigate to Managed DNS
2. Select your Domain
3. Click the Plus Button
Under the MX records section, click the + icon to add a new MX record.
4. Enter your desired record values
Please note the tooltip at the top of the page. This helps envision how the data populated in the fields will resolve.
Notice with the root record, we leave the name field blank.
Systems that have a static IP should usually have a TTL of 1800 or higher. Systems that have a dynamic IP should usually have a TTL of 1800 or less.
The lower the TTL the more often a client will need to query the name servers for your host’s (record’s) IP address this will result in higher query traffic for your domain name. Whereas a very high TTL can cause downtime when you need to switch your IPs quickly.
Simple MX record within the same domain
Name | TTL | Type | Data | MX Level |
mail1.example.com. | 1800 | A | 192.168.1.2 | |
example.com. | 1800 | MX | mail1.example.com. | 10 |
Configuration:
A record: For the A record configuration explanation please read more on the A-Data Entry page.
MX record details:
The end result of this record is that email for example.com. will go to mail.example.com which is located at 192.168.1.2. So if you send an email to username@example.com it will be delivered to the email server at the IP 192.168.1.2.
Advanced MX record configuration with email in the same domain and a different domain
Name | TTL | Type | Data | MX Level |
mail1.example.com. | 1800 | A | 192.168.1.2 | |
mail2.example.com. | 1800 | A | 192.168.1.4 | |
example.com. | 1800 |
MX | mail1.example.com. | 10 |
example.com. |
1800 |
MX | mail2.example.com. | 20 |
example.com. |
1800 | MX | mail100.backupexample.com. | 30 |
Configuration:
A record: For the A record configuration explanation please read more on the A-Data Entry page.
MX record details: