How to solve emails problems after site is migrated to Digital Ocean

July 7, 2016 1.2k views
DNS DigitalOcean Getting Started Ubuntu

I did the migration and successful. I moved by site previously hosted in Godaddy to now in Digital ocean. Site is running all fine.

One new problem. My emails are hosted with godaddy.
Now My emails have stopped working. How to solve this?

3 Answers
jtittle July 8, 2016
Accepted Answer

@JiteshShah

If I understand correctly, you're wanting to use DigitalOcean to host your actual website, but use the e-mail services provided by GoDaddy and the shared hosting plan that your website was previously on, correct?

If so, when doing a lookup on the domain businesslabs.org (the domain you've noted above), I see a few issues right off.

  • 1). It looks like you have two A entries, both of which point to businesslabs.org to the same IP. You need to remove one of those entries.

  • 2). The lookup doesn't report any valid MX entries, and without them, you're not going to receive e-mail.

  • 3). The lookup doesn't report any valid CNAME entries, and these are used by your MX entries, and without them, e-mail won't resolve to the noted mail.businesslabs.org.

So to get things in working order.....

Let's start fresh!

Whatever entries you have, whether A, MX, CNAME or other, delete them from within CloudFlare (not GoDaddy) and let's start from square one by adding our A entries first.

Adding A Entries

NOTE: I'll be using DROPLET_IP and GODADDY_IP as we move along. Simply replace DROPLET_IP with your DigitalOcean Droplet IP Address and for GODADDY_IP, you may need to get in touch with their support team. It all depends on whether the IP shows up in cPanel for you.

A       @       DROPLET_IP
A       www     DROPLET_IP
A       mail    GODADDY_IP

Most all DNS providers, including CloudFlare, accept @ as a reference to your domain, which is why I've used it in the above. This simplifies things quite a bit.

The www entry ensures that requests for both businesslabs.org and www.businesslabs.org will resolve equally.

The mail entry is what I was referencing above. Since MX entries do not resolve to IP's, a name must be available, so we're setting mail, which will reference mail.businesslabs.org from here on.

Adding MX Entries

Now we need to add an MX entry for mail.businesslabs.org

MX      0       mail.businesslabs.org.

Here we're setting a Priority of 0 for mail.businesslabs.org which is standard since you're not (to my knowledge) using multiple mail servers. This represents the highest priority.

If you have four input fields, you may need to use @ to reference your domain once again, in which case your MX entry would look like this:

MX      @       0       mail.businesslabs.org.

Adding Other Entries

At this point, we have proper A and MX records. You may have a CNAME setup for www -- it's not needed as we instead set www as an A entry (which is perfectly valid and actually more appropriate).

From here, if you need to add additional entries, simply add them as you did the above. When it comes to sub-domains, they should be setup as A entries. The only time you may need to use a CNAME entry is if GoDaddy requires it for mail. This is the default setup with cPanel, though I'm not really sure why as it simply complicates DNS resolution.

For example, if you've setup a A entry for your domain using:

A       @       DROPLET_IP

and a CNAME entry using:

CNAME   mail    businesslabs.org.

When mail is accessed, the routing looks something like this:

mail    ->  mail.businesslabs.org   ->  businesslabs.org

Whereas with with an A entry, the routing is cut down to:

mail    ->  IP

Are you wanting to keep your emails hosted with godaddy? If so, then you need to set the MX records of your domain name back to the godaddy mx. If your domain dns is controlled through godaddy, do it at the godaddy control panel. If you changed your domain name server to your own server, then set the mx at your own server to point to godaddy or else change the name server back to godaddy and control the dns settings there.

  • First: When I was first hosting my site and emails with godaddy i used cloudflare for CDN and so my DNS i can see in Cloudflare.

    Second: I have migrated my site to digitalocean but i want to use the same godaddy shared linux cpanel to use my email currently.

    Third: What should be dns setting i need to update in cloudflare to get my emails back to track?

    • Are you still using cloudflare for your DNS?

      What exactly did you change in the DNS when you migrated the site to DigitalOcean?

      If you changed the MX records, you need to change them back to GoDaddy. MX controls where the emails are sent.

      • Yes Sir, I am still using cloudflare for DNS.

        In the DNS i just changed the ipaddress - instead of ipaddress of godaddy shared hosting account, i replaced with the ipaddress of Digital ocean ipaddress which i can see in my droplet.
        Type | Name | Value | TTL |
        A | admin | points to 198.199.88.250 | Automatic

        A | businesslabs.org | points to 198.199.88.250 | Automatic

        In the above Value which points to ipaddress.. The ipaddress was of godaddy which is currently of my digital ocean droplet.

        In the MX records, it still shows the same which was previously:
        MX | businesslabs.org | mail handled by mail.businesslabs.org 0 |Automatic
        This is mail.businesslabs.org with priority set to 0

        But after migration, the emails have stopped working to receive emails.

        • You have indirectly changed your MX, that is why your email stopped working.

          Your MX is pointing to "businesslabs.org", and you changed "businesslabs.org" to a different IP address ... so, now the end result of that is that your MX is pointed to the digital ocean IP address.

          You need to find out what the GoDaddy MX should be, and change it to that.

          Do you have GoDaddy Workspace for your email? If so, you can find out what your MX should be pointed to here: https://www.godaddy.com/help/checking-mx-records-in-the-workspace-control-center-7590

          • Actually, though, I can't tell by your answer if your MX is currently set to "businesslabs.org" or "mail.businesslabs.org". Your reply seems to indicate it both ways.

            Regardless, neither of those domains are pointing to GoDaddy IP addresses. "businesslabs.org" is pointing to CloudFlare, and "mail.businesslabs.org" is pointing to DigitalOcean. GoDaddy is not in there at all.

First: When I was first hosting my site and emails with godaddy i used cloudflare for CDN and so my DNS i can see in Cloudflare.

Second: I have migrated my site to digitalocean but i want to use the same godaddy shared linux cpanel to use my email currently.

Third: What should be dns setting i need to update in cloudflare to get my emails back to track?

Have another answer? Share your knowledge.