Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2010-08-27
9
Medium Priority
?
1,202 Views
Last Modified: 2012-05-10
How to configure load balancing for MX records with 2 mailrelay servers?
0
Comment
Question by:sskay2000
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 2

Accepted Solution

by:
Sarcast earned 1000 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 1000 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 1000 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 1000 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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

One of the most often confused topics in the area DNS is the idea of GLUE records. Specifically, what they are, when they are needed, when they are provided, and how they are created. First, WHAT IS GLUE? To understand GLUE, you must first under…
Resolve DNS query failed errors for Exchange
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

604 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