Client needs domain A record to point somewhere else, but mail to point to me

GoWilkes

Well-Known Member
Sep 26, 2006
692
33
178
cPanel Access Level
Root Administrator
I have a hosting client that needed to change the A record for the main domain to another server, but needs to keep their email going through my server. I'm not quite sure how to set that up.

I had to add 4 A records to example.com. that points to their IP, and then delete the A record for example.com. that pointed to my IP.

The MX record for the domain is:

mail.example.com.
Priority: 0
Destination: example.com

There's a CNAME for mail.example.com that points to:

example.com

I understand that the MX record has to be a domain, not an IP. So can I change the CNAME for mail.example.com to an A record that points to my IP?
 

andrew.n

Well-Known Member
Jun 9, 2020
951
352
63
EU
cPanel Access Level
Root Administrator
Exactly that. Just setup an A record for mail.example.com and leave it as MX record too then you should be good.
 
  • Like
Reactions: GoWilkes

Daniel12345

Member
Apr 6, 2021
13
1
78
cPanel
cPanel Access Level
Root Administrator
Good day, GoWilkes!

As andrew.n stated, setting up an A record for mail.example.com and leaving it as the MX record is a good solution.

Alternatively, you can use another record that points towards your server such as your server's hostname A record.
 

GoWilkes

Well-Known Member
Sep 26, 2006
692
33
178
cPanel Access Level
Root Administrator
Thanks for the info! I changed the CNAME to an A record and my IP, and on my end everything looks like it's working. The client isn't in now so they'll let me know tomorrow if there's still a problem on their end.

Thanks again!
 
  • Like
Reactions: andrew.n

quietFinn

Well-Known Member
Feb 4, 2006
1,841
426
438
Finland
cPanel Access Level
Root Administrator
I understand that the MX record has to be a domain, not an IP. So can I change the CNAME for mail.example.com to an A record that points to my IP?
Correct, MX record must be a hostname, but the hostname can't be a CNAME record.