Question

Redirecting mail from digitalocean IP to cpanel

Posted March 24, 2021 191 views
DigitalOceanDNSUbuntu 18.04Ubuntu 20.04

I have been having an issue for the last few days. My mail is setup on cpanel. I have an CNAME record ‘mail.example.com’ pointing to my domain 'example.com’. After changing my domain’s A record to point to digitalocean i stop receiving mail but reverting back to cpanel ip the mail starts coming in. I tried setting up a subdomain 'mx1.example.com’ and created an MX record on digitalocean pointing to the subdomain but the mail still doesn’t come. Would anyone have a solution to this?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Hello, @mymbugua

You can simply point the MX record to the IP of the server where your emails are hosted. You can also point the MX to a subdomain like you did if the subdomain is pointed to the correct IP address as well.

Keep in mind that DNS changes might take up t 24 hours or even more due to DNS cache from the ISPs. I believe that you should start receiving your emails soon.

You can check the DNS using this tool here:

https://www.digitalocean.com/community/tools/dns

Hope that this helps!
Regards,
Alex

  • Thank you for the response. I don’t have the digital ocean NS records setup in cpanel. Would that affect how i am receiving mail?

    • Hello there,

      You don’t need to have the NS configured in cPanel unless you manage the DNS from there, but I assume you’re using DigitalOcean nameservers and you manage the DNS from the Control panel. If you edit the DNS from there, this is all you need,

      The other option will be to use external nameservers and manage the DNS records from a third party. In this case, you only change the DNS records from there.

      Can you confirm if the emails are working fine at the moment?

      Hope this makes sense.
      Regards,
      Alex

      • Hello

        We can send emails but we can’t receive emails. Currently the name servers aren’t digitalocean nameservers.

        • Hello there,

          Thanks for confirming this!

          In this case please make sure that the MX record is either set as the cPanel’s server hostname (e.g cPanel server is named mymbugua.digitalocean.com, set the MX to mymbugua.digitalocean.com) or create a CNAME record like mail.yourdomain.com and point it the IP address of the cPanel server.

          Hope that this helps!
          Regards,
          Alex