Content

What is an MX Record?

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. 

MX record points to the mail A record

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 delivered to the apex/root record of “yourdomain.com”.

How to Set Up MX Records

1. At the top of the control panel, click the DNS menu and select Managed DNS.

2. Select a domain from the either the Recently Updated Domains box, or start typing the domain name in the text box on the Select Domain tab.

3. Under the MX records section, click the + icon to add a new MX record. 

MX table record

4. Enter your desired record values. 

Please note the tool tip 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.

A) Name: This is normally always left blank for MX records. This will be the host for your domain which is actually a computer within your domain. Your domain name is automatically appended to your name. So if you leave it blank it will be the instructions on where to send email for your domain (ie. username@example.com).

B) Server: This will be the host (the mail server) that will accept mail for the host that is specified in the name field. Your domain name is automatically appended to your value if it does not end it a dot.

C) MX Level: 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:
Mail would always be first tried to be delivered to the MX record with MX Level of 10. If that mail server is down then the mail will try to be delivered to the mail server at 20. If the mail server at level 20 is down then the mail will be attempted to be delivered at the mail server at level 30. If the mail servers at level 20 and 30 are backup mail servers then the mail will be delivered to the mail server at level 10 when it comes back online.If you have multiple MX records with the same MX level then it will setup a round robin configuration for your email. The sending email server will not send email to both email servers.

D) TTL: The TTL (Time to Live) is the amount of time your record will stay in cache on systems requesting your record (resolving nameservers, browsers, etc.). The TTL is set in seconds, so 60 is one minute, 1800 is 30 minutes, etc..

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 of 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. Where as a very high TTL can cause downtime when you need to switch your IPs quickly.

Best Practice Tip
If you plan on changing your IP you should set your TTL to a low value a few hours before you make the change. This way you won’t have any downtime during the change. Once your IP is changed you can always raise your TTL to a higher value again.

E) Click Submit

6. You can also create MX records that point to external providers. Here we will create a higher priority MX record that points to a backup DNS Made Easy mail server. If mail.example.com is offline or not accepting email, mail will be sent to mx1.dnsmadeeasy.com.

Examples

Example 1 – Simple MX record within the same domain:

NAMETTLTYPEDATAMX LEVEL
mail1.example.com.1800A192.168.1.2
example.com.1800MXmail1.example.com.10

Configuration:

1
2

A record: For the A record configuration explanation please read more in the A – Data Entry page.

MX record details:

  • Name: example.com. is the host which we are making the MX rule for. In the data entry screen we leave the name field blank for the base domain.  For most MX record configurations the name is left blank.
  • Server: mail1.example.com. is the server that will accept email for example.com..  Since the domain name is appended to the end of the server value you just need to enter mail1.  If your mail server is in a domain that is outside your domain then you will want to append your FQDN with a dot (see the next example).
  • MX Level: 10
  • TTL (time to live): The 1800 indicates how often (in seconds) that this record will exist (will be cached) in other systems.
  • 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 email to username@example.com it will be delivered to the email server at the IP 192.168.1.2.

Example 2 – Advanced MX record configuration with email in same domain and different domain:

NAMETTLTYPEDATAMX LEVEL
mail1.example.com.1800A192.168.1.2
mail2.example.com.1800A192.168.1.4
example.com.1800MXmail1.example.com.10
example.com.1800MXmail2.example.com.20
example.com.1800MXmail100.backupexample.com.

Configuration:

3
4
5
6
7

A record: For the A record configuration explanation please read more in the A – Data Entry page.

MX record details:

  • Name 1 : example.com. is the host which we are making the MX rule for. In the data entry screen we leave the name field blank for the base domain.  For most MX record configurations the name is left blank.
  • Server 1: mail1.example.com. is the server that will accept email for example.com..
  • MX Level 1: 10
  • TTL (time to live) 1: The 1800 indicates how often (in seconds) that this record will exist (will be cached) in other systems.
  • Name 2 : Same as previous MX record.
  • Server 2: mail2.example.com. is the server that will accept email for example.com..
  • MX Level 2: 20 – Since this is the second lowest MX level this email server will be tried second (after the lowest MX record which is set at MX level 10).
  • TTL (time to live) 2: The 1800 indicates how often (in seconds) that this record will exist (will be cached) in other systems.
  • Name 3 : Same as previous MX record.
  • Server 3: mail1.example.com. is the server that will accept email for example.com..
  • MX Level 3: 30 – Since this is the third lowest MX level this email server will be tried third.
  • TTL (time to live) 3: The 1800 indicates how often (in seconds) that this record will exist (will be cached) in other systems.

Was this article helpful to you?

Comments are closed.