Portal Home > Knowledgebase > Articles Database > Double MX record, is it possible
Double MX record, is it possible
Posted by BonsaiRack, 12-05-2006, 11:59 AM |
The company I work with, will migrate is application to a web application and server and database will be hosted externally.
Our concern with this is if our internet links fail, we are not able to work.
So we were thinking of having a firewall/failover/loadbalancing solution. Basically two internet links from two different ISP, one adsl, and one cable.
The problem I think we will encounter is with our email. We have a website, but our email are redirected via mx record to our internal server on exchange. We have a dedicated ip.
My question is, if we go with the double isp solution, how can we manage the mx record. If main internet link 1 fails, how can mx record adjst to send to internet link2 the mail ?
Is it possible to specify two mx records ? and prioritize one and have the other as backup ?
Im on whm/cpanel.
Thanks
Patrick
|
Posted by zoid, 12-05-2006, 12:09 PM |
What you are asking is exactly what MX records are covering. Of course you can have multiple entries and of course you can indicate priorities for each server.
Please have a look at http://en.wikipedia.org/wiki/Mx_record
|
Posted by BonsaiRack, 12-05-2006, 12:16 PM |
Thank you for the link. Right on. But I do have a question after reading this :
So would it be better to specify a priority of 0 for both incoming internet link so we avoid some spam and virus ? Im concern that if I make the record be 0 and 1, the number one will attract spam and virus more then we allrady get.
|
Posted by zoid, 12-05-2006, 12:21 PM |
Assigning the same priority to both machines however wont make the second a fall-back but the set up will rather become a pseudo load balancing system as both machines will be considered equally important for the mail transfer.
If you assign your first/primary machine a higher priority and run on the second the same anti-virus/spam protection as on the first you wouldnt need to worry. The worst which could happen is that spam/worm senders will prefer the second machine and causing a unnessary higher load on it.
|
Posted by BonsaiRack, 12-05-2006, 12:27 PM |
We wont actually ahve two mail server, only one, but our link to internet will go through a load balancing firewall with two ISP.
so basically but mx record will point to same server.
I am just asking if having a priority 1 attract more spam/virus ?
If so, can we setup a bogus third mx record with priority 2 to send spam and virus in null ?
|
Posted by zoid, 12-05-2006, 12:32 PM |
If you have only one server why two MX records?
Of course you can add a third bogus entry too, but I wouldnt recommend it as you risk to lose true emails but will still receive a good amount of spam/worms as I assume only a small percentage will try to use such a trick.
|
Posted by BonsaiRack, 12-05-2006, 02:40 PM |
As stated in first post, we will have two mx records because we will have two isp incoming connection with a fail over/load balancing router, just to make sure we are not freeze because our application will strictly be on the web. Even a few hours without internet at 30 employees is crucial for us.
|
Posted by zoid, 12-05-2006, 03:07 PM |
I understood but I dont see the reason to have two identical MX records just because of two different network sources. What should be the reason behind it?
|
Posted by BonsaiRack, 12-05-2006, 03:32 PM |
These wont be two identical mx records, they will be from isp1.xxxxx.com and isp2.yyyyyy.com
That way, if we dont have internet incoming in our server ont ISP1 mail will still be delivered by isp2 , does that make sense ?
|
Posted by zoid, 12-05-2006, 06:26 PM |
I see, but then you actually have two mail servers and I dont understand fully what you previously meant with
|
Posted by foobic, 12-05-2006, 08:18 PM |
I think he's saying that the 2 MX records point to 2 different IPs on different networks but get routed internally to the same mailserver. Which should work when one or other link fails but the mailserver itself is still a single point of failure. Why not install a second mailserver relaying to the first?
|
Posted by BonsaiRack, 12-05-2006, 08:42 PM |
foobic you are right. our mail server is in-house. So I dont think it is a failure risk.
|
Posted by KNL-BSW, 12-05-2006, 09:45 PM |
A "Server" is a failure risk. You might see if you can find a company that would provide you secondary MX service.
This would give you a backup in case your mail server fails.
Secondary MX Servers usually just take mail and hold it till the main server comes back online then reroute it to the main server.
|
Posted by luki, 12-06-2006, 03:28 AM |
Looks like Patrick is not worried about the stability of the server, but of the Internet link. Which makes sense. It's "only" email, it will be queued elsewhere for some time. Depending your providers, the chance of the link going down is higher than the server dying.
Get two incoming connections from two ISPs, add a MX record for each, give the one you want to use more a higher priority (lower number) and you're good to go. I just checked my logs on the backup MX (priority 20) and it gets only a few messages (<1%) even though the primary MX has been up. So the spam problem described on Wikipedia isn't such a big problem -- most mail does go to the primary MX, spam or not.
|
Posted by BonsaiRack, 12-06-2006, 12:05 PM |
Yup, you are right. The server doesnt worry me as much as internet.
This is what I intend to do, 2 ISP, Two mx records for domain.com pointing to same router, which route to one email server.
|
Posted by Bum01, 04-25-2014, 11:53 AM |
I know this is an old thread and hope someone could help me out as we are in the same situation as BonsaiRack. Two IPs from different ISP connected to a 2 WAN port router which points to 1 internal mail server.
Example of our dns zone
A Host mail.xxxx.com 234.231.211.26 <-- IP from ISP 1
A Host mail2.xxxx.com 124.23.46.82 <-- IP from ISP 2
MX 10 mail.xxxx.com
MX 20 mail2.xxxx.com
Router
234.231.211.26 is connected to WAN 1 and is always active and in use
124.23.46.82 is connected to WAN 2 and is always active but NOT in use unless WAN 1 goes down.
The way this is setup seems to work where mail does flow properly when WAN 1 is up and when it goes down.
However, when WAN 1 does go down our mobile users will not be able to connect because they are using mail.xxxx.com as their SMTP server.
How can we configure it where our mobile users would not be affected regardless of WAN 1 being up or being down?
Thanks everyone!
|
Posted by Srv24x7, 04-26-2014, 10:53 AM |
Get both the IPs configured on your mail server. Create 2 MX records, each with different priority, say for example, one with 0 and other with 10.
|
Posted by Bum01, 04-28-2014, 10:58 AM |
I believe our MX records are good as it is.
Our problem is when WAN 1 goes down, mobile users cannot connect to our server because their SMTP server host name is set to the host name on WAN 1.
WAN 1's host name is mail.xxxx.com
WAN 2's host name is mail2.xxxx.com
When WAN 1 goes down, mail.xxxx.com is no longer reachable. Currently mobile users have to change their SMTP server to mail2.xxxx.com whenever WAN 1 goes down.
How can we setup a SMTP server where it always works when WAN 1 is up and when WAN 1 is down?
Thanks...
Last edited by Bum01; 04-28-2014 at 11:05 AM.
Reason: missing information
|
Add to Favourites Print this Article
Also Read