Solved

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

Posted on 2010-08-27
9
1,153 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
 
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
BIND is the most widely used Name Server. A Name Server is the one that translates a site name to it's IP address. There is a new bug in BIND (https://kb.isc.org/article/AA-01272), affecting all versions of BIND 9 from BIND 9.1.0 (inclusive) thro…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now