Knowledgebase: Domains
What is an MX Record?
Posted by Daniel Naval on 05 May 2019 04:24 PM

Mail Exchanger Record or MX Record is a resource record in the Domain Name System (DNS) that specifies the Mail Server who is accepting email messages from receiver’s domain. It simply tells the whole internet where your emails will be sent.

Use of MX Records

The main use of the Mail Exchange Records of a domain name is to specify how the emails should be routed using the Simple Mail Transfer Protocol (SMTP). Where, the SMTP is the Internet standard of email transmission, which is the most commonly used today.

Setting up Manual MX Record in the DNS Zone (in cPanel)

To setup or add an MX Record manually, you need to login to your cPanel and follow steps below.

1. In the Domains Section, click on “Zone Editor”.



2. Look for the domain name for which you want to Add New MX Record, then click + MX Record.


3. In the Add an MX Record box, you will be asked for the Priority and Destination.

4. The lowest number is the highest priorities. Zero (0) is the highest Priority.


5. On the Destination field,  type in the fully-qualified domain name (FQDN) of the mail server.

6. The FQDN consists of two parts; the hostname and the domain name. For example, mymail.ukhost4u.com. 

7. Click on Add an MX Record, the cPanel will then add the mx record.


 

To edit an existing MX Record 

1. In the Domains Section, click on “Zone Editor”.



2. Select the domain you wish to edit an MX Record and then click on Manage.


 

To delete an MX Record 

1. In the Domain Section, click on “Zone Editor”.



2. Select the domain you wish to delete an MX Record and then click on Manage. 

3. Locate the MX from the “Type” column and click on Delete. You can also select the MX from the filter on top the list.


Multiple MX Records
 

There are instances that you may have 2 or more MX Records. The main purpose of the other existing MX records are backup, and it is checked based on the priority or preference (on the domain level,  not on the email account level). This is to ensure that if one email server goes down, there will be other mail servers to handle the emails.


Preference, Distance and Priority

The Preference value is a number between 0 and 65,535 that indicates how preferable a record is relative to other MX records for the same domain. If the domain only has one MX record, the preference does not matter.

When a domain has multiple MX records existing, the lowest Preference is checked to decided which mail server will attempt to deliver the mail first. If the first delivery attempt fails, then the sender will attempt to deliver again using the MX Record that has the next lowest value. The process will continue to repeat until the mail has been delivered successfully or it runs out of MX records to check.

 

The Preference is also called the Distance or Priority of an MX Record.
 

How to check for the MX records of a domain.

 

For Windows Users:

 

1. Open Command Prompt (cmd.exe). By clicking on Start, and click on Run or just type in “cmd” on Search. (Many versions of windows, cmd is the most commonly used to get on the Command Prompt.) 

 

Once initiated, the command prompt window will appear. Then follow instructions below.

2. Type in “nslookup” and hit enter to go to the nslookup interface.

3. Next is to type “set q=MX” (this is to set query that is Mail Exchange Records) then hit enter.

4. Lastly, type in the domain name which you wanted to get the MX Records. (See image for your reference.)


 

On the image above, it shows that the MX Records for the domain “ukhost4u.com”. See below. 

ukhost4u.com MX preference = 20, mail exchanger = fallback.ukhost4u.com
ukhost4u.com MX preference = 10, mail exchanger = mx.ukhost4u.com

 

For Mac OS X and Linux Users: 

*Mac OS X users:  Open your Applications folder, then Utilities. Double click on the Terminal application.

*Linux Users: Just open your usual Terminal application.

 

Type in “dig mx domain.com” then hit enter. It will show the MX Records of the domain you are trying to check.

Note: For our query, we are checking ukhost4u.com’s Mail Exchange Records.



On the image above, it shows that the MX Records for the domain “ukhost4u.com”. See below. 

Domain Name TTL (Time To Live) Class DNS Record Type Priority MX Destination
ukhost4u.com 899 IN MX 20 fallback.ukhost4u.com
ukhost4u.com 899 IN MX 10 mx.ukhost4u.com

 

Multiple MX Records

For this query we used gmail.com for our domain.

Domain TTL (Time To Live) Class DNS Record Type Priority MX Destination
gmail.com 3599 IN MX 30 alt3.gmail-smtp-in.1.google.com
gmail.com 3599 IN MX 40 alt4.gmail-smtp-in.1.google.com
gmail.com 3599 IN MX 5 gmail-smtp-in.1.google.com
gmail.com 3599 IN MX 20 alt2.gmail-smtp-in.1.google.com
gmail.com 3599 IN MX 10 alt1.gmail-smtp-in.1.google.com


The numbers in the priority field tells us which server will be the first one to be used. The lowest number is the Highest Priority.

If a mail server is trying to send an email to gmail.com and unable to reach the 1st priority, then it will try to reach for the 2nd Priority with the lowest number.


Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).