Inbound Mail or MX Load Balancing

Why load balance inbound emails?

if we have thousands of emails to receive per hour, one single server may get exhausted by queuing and processing all these emails.

by deploying multiple MX servers we can evenly distribute the inbound email load to all of them. MX servers at the front, are responsible for email protection also, the email filtering process is time-consuming.

If there is a heavy load like spam attacks, mail delivery will delay, and email missing can occur, to overcome these situations, we must load balance the inbound flow to the other servers for quick processing and smoother delivery.

Design1, Load balancing with MX Record

Email load balance with DNS round-robin

in the above diagram, we have three MX servers mailx1, mailx2, and mailx3. For DNS round-robin to work, we have to declare all of them with the same MX priority. if MX records have the same priority values, DNS will deliver the server IPs in a round-robin fashion. whenever any sender tries to find our mail server, it will ask our DNS server, and the DNS will answer with all these 3 servers in a round-robin fashion, later we will see this in practice.


Let’s say these servers’ IPs are, 202.191.120.1,  202.191.120.2, and 202.191.120.3. and we want to receive emails for the domain mailserverguru.com. We have to setup the DNS A and MX record’s this way:


mailx1             IN           A               202.191.120.1
mailx2             IN           A               202.191.120.2
mailx3             IN           A               202.191.120.3


@             IN           MX         10           mailx1.mailserverguru.com.
@             IN           MX         10           mailx2.mailserverguru.com.
@             IN           MX         10           mailx3.mailserverguru.com.


To learn More about DNS Round-Robin Please watch This video


To learn DNS Round-Robin Setup on Godaddy DNS Please watch this video


Configure Email Routing


After setting up the DNS Part, we need to configure the Email routing to deliver the inbound emails to the respective mailbox server because all user’s inboxes are in the mailbox server. In the 1st diagram, we received mail for a single domain. all the MX servers routed mail to the backend mailbox server.

Email Routing for multiple domains



in this 2nd diagram, we are receiving mail for multiple domains, now all the MX servers must make a routing decision based on the recipient’s domain name or recipient email address. Here, we can see all incoming servers are delivering emails based on the recipient domain to a different server.

Later I will show you how to configure the email routing on the servers.


Thanks !!

Rahman Munna
Rahman Munna

Rahman Munna is an accomplished IT professional with over 15 years of experience specializing in System Administration across Linux, Windows, and Virtualization Technologies. With a strong focus on Email and Web Server Administration, Rahman has a proven track record of managing and optimizing complex IT infrastructures for multinational organizations.

Leave a Reply

Your email address will not be published. Required fields are marked *