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?
MX
record can only be an hostname, not an IP address. Just put the A record to the IP of the website, do anMX
record tomail.example.com
and add anA
record for that name to the IP address of your mail hosting server.