Set Up MX Record for Email in cPanel
MX (Mail exchanger) record is a type of resource record in the domain name system that specifies which mail servers are responsible for receiving emails for the domain. You can read more about it at http://en.wikipedia.org/wiki/MX_record
When you order a web hosting account, by default your hosting server where your website is hosted also has a mail server. Therefore MX record is automatically created to specify your web hosting server to be the mail server as well and receive emails. That is why you can create and manage email accounts using cPanel interface, which directly interacts with the local mail server on that server.
However at times some clients want to host their email elsewhere. For this reason they will need to change the MX record so that emails can go that particular server. To change the MX, you can click on MX Entry in Mail section of cPanel. For some reason cPanel calls it MX Entry instead of MX Record.
Priority in MX Record
Since it is possible to have multiple mail servers configured to receive emails for a domain, the next screen explains how the priorities work MX records (entries).
- Lower values denote higher priority, with 0 being the highest possible priority.
- The primary mail server(s) (with the lowest-numbered priority) will receive mail sent to your domain.
- Secondary mail servers (those with higher priority values) can be used for backup or other purposes.
- If you assign multiple mail servers the same priority, then when that level of mail server is needed, mail will be distributed to those servers randomly.
You may have to select the domain from the drop down to proceed.
Once you select the domain, you will be presented with the current MX configuration of the domain. For example in this screen shot here we see that domain is configured to receive email on Local server. It is currently using “Automatically Detect Configuration” option to come up with that.
You can keep it as it is i.e. let cPanel automatically detect configuration, or you can choose one of the other three options. They are as follows:
Local Mail Exchanger: Configure local server to always accept mail. Mail will be delivered locally on the server when sent from the server or outside the server.
Backup Mail Exchanger: Configure server as a backup mail exchanger. Mail will be held until a lower number mail exchanger is available.
Remote Mail Exchanger: Configure server to not accept mail locally and send mail to the lowest MX record.
Please be careful with changing this. The Warning is pretty clear: Setting the wrong option here can break receiving mail on your server. If you are at all unsure about which option to select contact your system administrator (that is our support).
You can click on Change button to make the change (if required).
Since there can be multiple MX records in a domain, you can see the listing of your current MX Record(s). You have the option to edit or delete the record:
If you click Edit, it you can modify the Priority or Destination:
Or you can add a new record as well:
Once you are done with the changes, you can see that all the records under MX Records section are what you needed to set. It may take a few hours before the DNS updates propagates and new email starts delivering on the MX records for your domain.