Hosting website and emails on different servers

Web Hosting packages usually include email hosting too. So you don’t have to configure anything separately for emails apart from creating required email accounts from cPanel. But if you have decided to host your emails on a different server, you have to make some DNS configuration changes to your domain.

 

Adding  MX record to your domain name

MX record stands for Mail Exchanger record. MX record tells your domain where to deliver the incoming emails. This is very similar to how Nameservers are used to map your domain to your web server. In short, MX records helps determine to which email server your emails should be delivered.

 

Go to DNS Zone File Editor.

adding MX record to your domain name

MX record

 

You might see a message like the one that follows.

DNS Zone file unavailable message goddady

 

 

The error message “The zone file is unavailable because the domain’s set nameservers do not belong to this registrar.” means, to make changes to DNS zone configuration file, your domain should point to the default nameservers (every domain registrar has a default nameserver). If you have used a different nameserver to point to your web server currently, you will not be able to create an MX record or make any other changes to your domain’s DNS settings.

Setting your domain’s nameserver to default nameserver is very simple but you have to be very careful. Once you set your domain to point to default nameservers, your website will no longer be accessible. Because your domain is not pointing anymore to the web server where your website files are stored.

ALSO READ  Creating a cron job in cPanel to run PHP script

So to point to your web server, we can create an ‘A’ record that points to your web server. So you should first set your domain to point to default nameservers, then create an ‘A’ record to map your domain and web server and then create required MX records. It’s simple. Follow the steps below.

 

Setting domain to point to default Nameservers

  1. Go to your domain settings.
  2. Click “Manage” under Nameservers.

Manage nameservers godaddy

3. Choose “Standard” setup type and hit “SAVE”.

Hosting website and email separately

 

Creating an ‘A’ record to point to your web server

Make sure that you do these changes during non-peak hours. Because your website may go down for a while – until your ‘A’ record gets propagated.

  1. Select “A (Host)” record type.
  2. Type “www” in Host.
  3. Type your web server IP address in “Points to”.
  4. Click “Add another” button.
  5. Now let’s add your server IP address for the non-www version of your domain. Type “@” (without quotes) in Host.
  6. Type your web server IP address in “Points to”.

Point to website IP from A record

 

 

 

 

Now we are good to go with adding new MX records.

  1. Select MX (Mail Exchanger) record type.
  2. Type “@” (without quotes) in “Host”.
  3. Type name of the new mail server in the “Points to” text box. This will be provided by your email service provider. For example: to host your email on Google apps for custom domain, you should use “ASPMX.L.GOOGLE.COM.” (including the trailing dot) as your mail server name in “Points to” text box.
  4. Add a priority to this record. This too is usually provided by the email service provider. Mail servers with lower priority values are tried first.
  5. Hit “Finish” after adding all the MX record as given by your email service provider. This completes our configuration.
ALSO READ  6 reasons why PHP sites show errors after server migration

hosting-emails-different-sever

 

How long does it take for your MX changes to take effect?

It depends on the TTL (Time To Live) value specified in your old MX record. If it is set as 4 hours, the new MX record will take 4 hours to take effect. You can check the status of your current MX record at mxtoolbox.com

 

One Response

  1. SAKIR SAHIN August 24, 2016

Leave a Reply