2

I got my webserver where my website is hosted and my mail server on two different servers with different IPs.

I would like to have mail email @example.com using the mail server I have used an A record on my DNS for example.com to point to my web host IP and an MX record for example.com that points directly to the mail server IP.

Now, pointing directly the MX record to an IP is not the best option as intoDNS reports

MX is not IP ERROR: Some of your MX records returned by your nameservers are IP addresses. This is not ok per the RFCs and you should change them.

I would like to create an MX record that points to a domain for my email IP address but, at the same time, I would like to keep using example.com for the emails, even if the mail server is on a different IP.

How should I set up the DNS records?

2
  • 3
    By design of the DNS, the "target" of an MX record can only be an hostname, not an IP address. Just put the A record to the IP of the website, do an MX record to mail.example.com and add an A record for that name to the IP address of your mail hosting server. Feb 12, 2020 at 20:54
  • @PatrickMevzek this should be an answer, not just a comment.
    – Trebor
    Feb 13, 2020 at 2:13

1 Answer 1

5

By design of the DNS, the "target" of an MX record can only be an hostname, not an IP address.

Just put the A record for example.com to the IP of the website, do an MX record to mail.example.com and add an A record for that name to the IP address of your mail hosting server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.