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
Solved

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

Posted on 2010-08-27
9
1,166 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Macbook Sierra OS OpenVPN issue 13 108
DNS Redirection 6 37
Create a reverse dns entry on godaddy because we own our IP and use BGP 8 30
NSLOOKUP Question 7 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.…
I've written instructions for one router type, but this principle may be useful for others of the same brand and even other brands of router. Problem: I had an issue especially with mobile devices that refused to use DNS information supplied via…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

809 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