Solved

How to configure load balancing for MX records with 2 mailrelay servers?

Posted on 2010-08-27
9
1,159 Views
Last Modified: 2012-05-10
How to configure load balancing for MX records with 2 mailrelay servers?
0
Comment
Question by:sskay2000
  • 4
  • 3
  • 2
9 Comments
 
LVL 5

Expert Comment

by:Eikroman
ID: 33539712
Since your are posting in DNS, I assume you are talking about DNS based load balancing.
http://www.zytrax.com/books/dns/ch9/rr.html#mail

An alternative would be a gateway(firewall) load balancer. But this requires that you provide information about your environment.
0
 

Author Comment

by:sskay2000
ID: 33539814
I have configured my DNS as below:

        IN  MX  10  mail.example.com.
IN  MX  10  mail.example.com.

....
mail    IN  A       192.168.0.4
        IN  A       192.168.0.5
        IN  A       192.168.0.6
0
 

Author Comment

by:sskay2000
ID: 33539868
We have 2 Mailrelay servers and the given MX records are pointed to these mailrealy servers respectively. I have configured my DNS as below:

IN  MX  10  mail.example.com.
IN  MX  10  mail2.example.com.

IN  A       192.168.0.4
IN  A       192.168.0.5

In this scenario how DNS round robin Works? Will it provide a failover solution? What will happen If  the mail.example.com. fails?


0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 2

Accepted Solution

by:
Sarcast earned 250 total points
ID: 33540077
From:
http://www.msexchange.org/tutorials/Load-Balancing-Exchange-Front-End-Servers.html

Round Robin DNS is an easy method available to load balance web servers. An Exchange server really is nothing more than a web server and round robin DNS is a simple solution you can use to load balance the front-end servers. Round robin works by assigning multiple IP addresses to the fully qualified domain name (FQDN) of a resource. The IP addresses are rotated so that one server IP address is handed out first, then the next request is given the next IP in the list. This repeats as each DNS resolution is handled, moving down the list of IP addresses until you get to the end of the list, which starts the whole process over. Another upside is that you don’t need any special hardware; the standard network interface card in any server will work.

Round Robin DNS is not fault tolerant. If a user receives the IP address of a down server, they will get an error message. This is usually resolved by refreshing a few times, but they may have to go a step further and purge the local DNS cache before they get the IP address of a functional server. For this reason a low TTL value is recommended.

I guess to make this fault tolerant you'd need to either cluster the 2 relay servers.
or setup different MX records, ea; MX10 MX20 (downside of this is that there is no loadbalancing)
0
 
LVL 5

Expert Comment

by:Eikroman
ID: 33540084
IN  MX  10  mail.example.com.
mail    IN  A       192.168.0.4
        IN  A       192.168.0.5
        IN  A       192.168.0.6

In this scenario - it's up to BIND which ip to supply. So the remote mail server will get only one of those IP and if it's unreachable (relay server down), the delivery will fail.

If you specify
   IN  MX  10  mail.example.com.
   IN  MX  10  mail1.example.com.
   IN  MX  10  mail2.example.com.
mail  IN  A       192.168.0.4
mail1 IN  A       192.168.0.5
mail2 IN  A       192.168.0.6

It's up to remote mail server to decide. it will see all of the possible IP and since it its logic incorporates it, it will resend using other MX records.

0
 
LVL 5

Assisted Solution

by:Eikroman
Eikroman earned 250 total points
ID: 33540111
By BIND - I mean any DNS server you might have.

And a typo in the last statement: IF the logic  of a sending server incorporates load round-robin selection of MX records with equal priority, then it will load balance, but it will definitely failover.
0
 

Author Comment

by:sskay2000
ID: 33540308
I have the 2 MX record with same priority. If  one of the MX record (mail.example.com.) is not reachable then will the emails sent to me Bounce or will it be delivered using the second MX record (mail2.example.com) automatically.
0
 
LVL 5

Assisted Solution

by:Eikroman
Eikroman earned 250 total points
ID: 33540340
As I said, typicaly it will fail over to the second server so email will be delivered.

That's the primary reason of having multiple MX records in the first place.
0
 
LVL 2

Assisted Solution

by:Sarcast
Sarcast earned 250 total points
ID: 33540433
From: http://en.wikipedia.org/wiki/MX_record

The basics
When a server decides to send SMTP mail, the relative priority of an  MX server is determined by the preference number present in the DNS MX  record of the recipient's domain. When a remote client (typically  another mail server) does an MX lookup for the domain name, it gets a  list of servers and their preference numbers. The smallest preference  number has the highest priority and any server with the smallest  preference number must be tried first. To provide reliable mail  transmission, the SMTP client must be able to try (and retry) each of the relevant addresses in this list in order, until a delivery attempt succeeds.[2]  If there is more than one MX record with the same preference number,  all of those must be tried before moving on to lower-priority entries..


Why have priority?
A common misconception about the MX preference ordering is that it is  intended to increase the likelihood that mail may be delivered;  however, merely having multiple MX records with the same preference  provides this benefit (see below). Because the MX preference ordering  specifies that some servers should be tried first, it is, if  anything, a means of establishing load imbalance. Another common  misinterpretation of MX preference ordering is that it is intended to  provide a means of "failover" in the case of server overload. While it  can be used that way, it is a poor resource management technique because  it intentionally creates overload and does not fully utilize the  available hardware. Assigning the same preference value to all of the  available servers provides the same benefit and may even help avoid  overload situations and thereby increase system throughput by decreasing  latency.


0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most DNS problems are VERY easily troubleshot and identifiable if you can follow the steps a DNS query takes. I would like to share the step-by-step a DNS query takes from the origin to the destination. _____________________________________________…
This article is intended as an extension of a blog on Aging and Scavenging by the MS Enterprise Networking Team. In brief, Scavenging is used as follows: Each record in a zone which has been dynamically registered with an MS DNS Server will have…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question