Web Hosting Talk







View Full Version : Email Hosting Vs Website Hosting


farhan713
08-26-2009, 12:16 PM
Can someone explain, how can you keep your emails with one host and host your website with another?
I have a client who has hosting with me but emails with another. They have put a A pointer to point to my hosting ip and the site is working fine. What should point to the other email hosting company for the email to work properly?

Also if anyone can point to a resource where I can read and understand all the MX records available their functions and how they work, that would be a nice guide for us newbies.
Thanks for reading everyone.

bangweb
08-26-2009, 02:42 PM
Hi Farhan713,

This is very easy to do. To start with, you need to make these changes in the authoritative name servers for the domain in question. From your example it sounds the other company has that honor.

They have the zone file (the text file that holds the domain and host info). In that zone file they have a record for your web server an "A Record" aka Host Record.

Linux:
(your ip for web hosting)
yourdomain.com. IN A 10.10.10.12
www IN A 10.10.10.12

(A Record for their ip for mail)
mail IN A 35.35.35.36

(mx record to tell the rest of the internet which server to go to for mail - the mail host record above will tell the remote mail server the ip address of your mail server)
yourdomain.com. IN MX 0 mail.yourdomain.com.

The 0 can really be any number. It only has meaning if you have more than one mail server. The lower the number the higher the priority. For example, let's say you have a primary mail server and a backup mail server. you want the primary mail server to always receive mail unless it's unreachable, then use the secondary. Then you would set your records up like:

mail01 IN A 35.35.35.36
mail02 IN A 35.35.35.37
yourdomain.com. IN MX 10 mail01.yourdomain.com.
yourdomain.com. IN MX 20 mail02.yourdomain.com.

I hope this helps.

Regards,
Bang

mooseweb
08-26-2009, 06:06 PM
Hi Farhan713,

This is very easy to do. To start with, you need to make these changes in the authoritative name servers for the domain in question. From your example it sounds the other company has that honor.

They have the zone file (the text file that holds the domain and host info). In that zone file they have a record for your web server an "A Record" aka Host Record.

Linux:
(your ip for web hosting)
yourdomain.com. IN A 10.10.10.12
www IN A 10.10.10.12

(A Record for their ip for mail)
mail IN A 35.35.35.36

(mx record to tell the rest of the internet which server to go to for mail - the mail host record above will tell the remote mail server the ip address of your mail server)
yourdomain.com. IN MX 0 mail.yourdomain.com.

The 0 can really be any number. It only has meaning if you have more than one mail server. The lower the number the higher the priority. For example, let's say you have a primary mail server and a backup mail server. you want the primary mail server to always receive mail unless it's unreachable, then use the secondary. Then you would set your records up like:

mail01 IN A 35.35.35.36
mail02 IN A 35.35.35.37
yourdomain.com. IN MX 10 mail01.yourdomain.com.
yourdomain.com. IN MX 20 mail02.yourdomain.com.

I hope this helps.

Regards,
Bang

Wow that was a great explanation, I was thinking of just telling him it was based around the DNS records, although this makes my response look very dull.

Good post, thanks!

farhan713
08-27-2009, 03:41 AM
Hi Farhan713,

This is very easy to do. To start with, you need to make these changes in the authoritative name servers for the domain in question. From your example it sounds the other company has that honor.

They have the zone file (the text file that holds the domain and host info). In that zone file they have a record for your web server an "A Record" aka Host Record.

Linux:
(your ip for web hosting)
yourdomain.com. IN A 10.10.10.12
www IN A 10.10.10.12

(A Record for their ip for mail)
mail IN A 35.35.35.36

(mx record to tell the rest of the internet which server to go to for mail - the mail host record above will tell the remote mail server the ip address of your mail server)
yourdomain.com. IN MX 0 mail.yourdomain.com.

The 0 can really be any number. It only has meaning if you have more than one mail server. The lower the number the higher the priority. For example, let's say you have a primary mail server and a backup mail server. you want the primary mail server to always receive mail unless it's unreachable, then use the secondary. Then you would set your records up like:

mail01 IN A 35.35.35.36
mail02 IN A 35.35.35.37
yourdomain.com. IN MX 10 mail01.yourdomain.com.
yourdomain.com. IN MX 20 mail02.yourdomain.com.

I hope this helps.

Regards,
Bang

thanks bangweb for taking the time for the detailed explanation.