DNS Records: point only files to a server ip, keep emails on the other one

82 Views Asked by At

So i have this two servers that i need to configure:

-Server s1 is on hostpappa (shared)

-Server s2 is a vps i own

What i need to do is keep emails hosted on s1 and the website hosted on s2. What i tried was to change A record from mydomain.com to point to s2, but emails didn't work anymore. Is there any way i can do this with dns records?

After the first attempt failed, i tried to create on s2 a cname email.mydomain.com pointing to s1 ip and adding a mx record to this newly created cname. This failed also.

1

There are 1 best solutions below

0
On BEST ANSWER

You'll want:

  1. An A record for mydomain.com pointing at the IP address for s2,
  2. An MX record for mydomain.com pointing at the hostname of your email server.

The MX record in 2 should not point to a CNAME (this violates the requirement of section 10.3 in RFC2181. That could have been causing the trouble with email.