DNS A Record Change – How to Keep Email Working with MX Record Pointing to Domain

domaindomain-name-systememail-servermx-record

For my client, I'm migrating domain to point to a new website server. In order to do that, I'm changing A records to point to new server IP. After such change, client has lost possibility to send e-mails from his mail accounts located on old server. DNS Configuration is as follows:

Domain name: example.com

Host Type Content
@ A XXX.XXX.XXX.XXX
www A XXX.XXX.XXX.XXX
@ MX 10 example.com

After changing A records to YYY.YYY.YYY.YYY it seems like the MX records are now pointing to IP of new server, which does not have mail functionality, and that stops the e-mail from working. Can I somehow point the MX record towards the old server?

Best Answer

Since your MX record currently points to the domain itself, that means it's essentially pointing to the @ DNS record. So when you update that the MX destination is changed.

Add an additional A record to the domain which points to the old server, for instance mail.example.com, and then point the MX record to that A record rather than the main ones that are being moved. So you end up with this.

Host Type Content
@ A YYY.YYY.YYY.YYY
www A YYY.YYY.YYY.YYY
mail A XXX.XXX.XXX.XXX
@ MX 10 mail.example.com
Related Topic