Introduction
When a domain resolves to another server, but you want to host the email for the domain on the local server, you have to point the domain's MX records to a hostname that resolves to the local server.
Procedure
Please note that DNS record changes need to be performed on the authoritative nameservers. If your cPanel server is not the authoritative nameserver for the domain, changes to the local DNS records will not be seen by DNS queries.
- Access the domain's DNS management interface.
- Review the host record of the domain's mail server (this is usually "mail").
- If the record is an A record, update the IP address to point to the local server's IP address.
- If the record is a CNAME record, change the CNAME to an A record that points to the local server's IP address or update the CNAME record to point to a hostname that resolves to the local server's IP address.
- If the record doesn't exist, create an A record for the mail host that points to the local server's IP address.
- Review the domain's current MX record.
- If the MX record doesn't exist, create an MX record that point to the mail hostname.
- If the MX record exists, update the MX record to point to the mail hostname.
- Save the changes.
Additional resources
How to add a DNS record in cPanel and WHM