Editing an MX DNS record from the Cloudflare control panel
This article describes the steps necessary to edit an MX DNS record from the Cloudflare control panel, in the event that protection is provided by setting their custom nameservers.
Introduction
There are two ways to activate the Cloudflare service for DNS management:
- Setting the Cloudflare nameservers on the domain, managing the DNS zone directly from the Cloudflare administration panel.
- Activating the service from the hosting cPanel, without the need to modify the domain's nameservers.
If the protection is enabled by setting the nameservers on the domain, the DNS zone of the domain will be managed exclusively in the Cloudflare account. Additions, deletions, or edits will be made in the Cloudflare panel, thus replacing the DNS zone on the server where the site is hosted.
In this tutorial, we will go through the necessary steps to edit an MX DNS record and present two examples of email routing, using either the domain or the IP address of the email server.
Requirements
To follow the steps in the tutorial, you need the following:
- The IP address or the domain name of the email server to which you want the email traffic to be routed.
- An active account on Cloudflare.
Steps
- Log in to your Cloudflare account by accessing https://dash.cloudflare.com/login.
- Click on the site for which you want to make DNS changes.
- In the page that opens, select the DNS option from the blue navigation bar.
- In the displayed list, look for the corresponding MX record, for example: DOMAINNAME mail handled by MAIL.DOMAINNAME 0 automatic.
This registration is responsible for routing emails to the email server indicated after mail handled by.
Change using the email server domain
- If you own the domain of the email server, only change the mail handled by field in the MX record. Enter the desired domain and set the priority (e.g. 0 for maximum priority), then save the changes.
After the modification, all emails will be routed to the specified domain, for example, mailserver.example.com.
Changing using the email server's IP
- If you do not know the email server domain name, use the IP address. Look for the corresponding A record of the domain or subdomain mail, which looks like this: mail DOMAINNAME points to 77.81.2.1 automatic.
- Edit the points to field by entering the new IP of the email server, then save the changes.
After the propagation of changes (which can take a few hours), emails will be routed to the server indicated by the IP. For example, the DNS record mail.hostico.ro will point to the IP 188.241.222.2, and the MX record will route emails to this subdomain.