Solved

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

Posted on 2010-08-27
9
1,155 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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Guest VLAN not syncing email 13 32
Public DNS 2 42
help!! No network & No Internet connectivity 4 53
2012 r2 branch office DNS 2 19
I will assume you are running a non-server version of some sort of Windows throughout this article. There are many flavors of Windows since Windows Server 2000 - 2008, XP Home & Pro, Vista Home & Pro, and Windows 7 Starter, Home, Pro, Ultimate, etc.…
Resolve DNS query failed errors for Exchange
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

863 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

28 Experts available now in Live!

Get 1:1 Help Now