How to redirect mail to another service

Written by Administrator on Saturday July 20, 2024

This article is a manual for those, who has a hosting for their website, but wants to their mail to be processed on another hosting. This can happen for example in cases, when your website hosting company is charging additional fees for every mailbox you create (for example, Hostinger in their standard plans allows you to host website, but in case you want to create mailboxes, they will force you to buy subscription for Titan mail for every box you want to create).

So, let's take my example of two hosting companies. 

First one: Hostinger: I'm hosting the whole website there, but don't want to pay for mailboxes (I think in case you have hosting you have to have an ability to create as many mailboxes as you want). This hosting will be used for hosting only a website.

Second one: HmdsGroup / Entirely Digital I have a hosting plan here, but want just to process mails for my website, which is hosted at Hostinger. This hosting will be used for processing mail for a website.
 

Redirecting mail from one hosting to another - manual

1. Step: Creating a subdomain

First of all we have to create a subdomain on a hosting, where we want to process mail:

mail.exampole.com

2. Step: redirecting mail using MX-records in DNS

Now you have to edit your DNS-records. In my situation domain name is registered at totally different domain names registrator and I've changed NS to those, where I host my website. This is how it looks at my domain's registrator:

Those servers:

ns1.dns-parking.com
ns2.dns-parking.com

are NameServers of Hostinger company, where my website is being hosted. Just keep in mind, that once you change nameservers you cannot edit your DNS-records. In my case I changed NameServer to Hostinger, and it means that from that moment I'm editing DNS-records at Hostinger.

Now we have to edit DNS-records and add MX-records pointing them to a subdomain. On my Hostinger account (where website is hosted and to where NS are pointing) I'm deleting all existing MX-recrods and add the following record:

telling that mail processing will happen on Hmdns hosting (where only mail will be processed and where a subdomain (mail.example.com) was created.

That's all. Now I can create as many mailboxes on HmdnsGroup hoster as I need. 

My website is hosted on Hostinger, but all mail is processed on HmdnsGroup.

3. Turning on DKIM

It's highly possible, that you will have to set up DKIM verification for your mail servers. This is how you make it.

On you account on HmdnsGroup (you will surely have different hoster), you go to:

E-mail manager → E-mail accounts

And on the right side you turn on DKIM:

Right after that you go to DNS Management and you will see automatically generated DKIM in you DNS-records:

Now the only thing you have to do is to copy this records and paste it to a DNS-records of your main domain. So, I just copy the code from HmdnsGroup (hosting, where my mail is being processed), and paste it as a new DNS-records on a hosting, where main DNS-records are stored (in my case - Hostinger) - keep in mind, that it must be a DNS record of the following format:

record type: TXT
name: x._domainkey
priortiy: 0
content: (copied DKIM code)

In my case it looks like this:



Now your mail is DKIM verified and you can use it.

Tags: dns NS