Sometimes, when moving sites from one server to another or working across multiple platforms, you will need to point your domain’s MX Record to a different IP address. Here is an easily reversible way to do so without affecting the rest of your site’s DNS entries.
While this article uses the cPanel Zone Editor to explain the process, the same principles will apply on any DNS records!
Point the MX Record
Your site’s DNS records are a sort of address book that helps computers find information online. DNS records are the reason typing inmotionhosting.com takes you to our homepage and not a random computer that someone named InMotion!
You can think of MX records as an address label for email. Usually email is delivered to the same IP address as your website, but sometimes this is not the case. Perhaps you want your mail routed to a separate e-commerce site, or you’re redirecting your emails to a security service.
Here’s the tricky part: you cannot simply point your MX records to a new IP address because MX records never point to an IP address. MX records always point to an A Record, the type of DNS entry that does point to an IP address. The trick is to repurpose the ‘mail’ subdomain and turn it into a valid A Record.
- Login to cPanel
- Go to the cPanel Zone Editor and click on Manage for the domain you are working on
- Use Edit to change the mail subdomain from a CNAME to an A Record by clicking edit, entering the IP address for your mail, and clicking Save Record
- Now, edit your domain’s MX Record, changing it from pointing to your domain to the ‘mail’ subdomain and remembering to click Save Record
Congratulations! Your mail is now being directed to a different IP address. Remember to wait for the changes to propagate through the DNS. By making the change this way, all you have to do to reverse it is point your MX record back to your primary A Record and turn the ‘mail’ subdomain back into a CNAME!
Remember Mail Routing
If you make this change in cPanel, be sure to set Email Routing to remote. This is especially true if you have a WordPress site, as certain WordPress form plugins may attempt to deliver to local email inboxes unless explicitly told otherwise. Setting email routing to ‘remote’ prevents you from losing important messages sent through WordPress.