DNS
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationDNS

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old August 11th, 2003, 01:56 AM
mullas mullas is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 12 mullas User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation MX load balancing using round robin method?

Greetings Everybody!

I was wondering how company's, using the round robin mechanism as a form of load balancing for their mail servers, makes it possible for clients to fetch their e-mail? As far as I know, using the round robin technique, mail is sent randomly among the two, or more, mail servers defined in the zone's MX records? So when a client, like myself, want to fetch their e-mail, we simply define a POP3 server, for incoming mail, in our mail client software. But we are often only able to supply information regarding one POP3 server?

So when I check for new e-mails, I could be asking one of the other mail servers, and this one might not hold any e-mails, instead of the one that was picked randomly to hold the new e-mail?

Take a look at this zone information:
Quote:
mx1.domain.tld. IN A 10.0.0.1
mx2.domain.tld. IN A 10.0.0.2

domain.tld. IN MX 10 mx1.domain.tld.
domain.tld. IN MX 10 mx2.domain.tld.
domain.tld. IN MX 20 backup.mailserver.tld.

mail.domain.tld. IN CNAME mx1.domain.tld.
mail.domain.tld. IN CNAME mx2.domain.tld.


Does these company's use some kind of file-sharing or fetch-mail-from-remote-server solution? Another question would be, wouldn't DNS caching cause some problems whenever One take use of the round robin mechanism?

Hope my question makes just a little bit of sense.
Best regards, bluePrint.

Reply With Quote
  #2  
Old August 11th, 2003, 08:46 AM
SilentRage's Avatar
SilentRage SilentRage is offline
DNS/BIND Guru
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jun 2003
Location: OH, USA
Posts: 4,193 SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 5 Days 14 h 27 m 56 sec
Reputation Power: 77
I learned something new researching your answer.

Here's a rewritten zone based on your example:

---------------------------------------------------------
domain.tld. IN MX 10 mail.domain.tld.
domain.tld. IN MX 20 backup.mailserver.tld.

mail.domain.tld. 0 IN A 10.0.0.1
mail.domain.tld. 0 IN A 10.0.0.2
---------------------------------------------------------

Changes I have made and why:

1) Removed CNAMES.
1a) You had 2 CNAME records listed under 1 host. This is forbidden by RFC standards.
1b) In this case using CNAME's is redundant and increases dns traffic load somewhat. I had renamed the mx domains to mail for consistency.

2) removed second MX entry with same preference number. We do not want to use round-robin on the MX records. MX records are to be used to place priority of one server over another when the primary server goes down. With this new setup, only mail.domain.tld will be used unless it is down.

3) doubled up the 2 mail server IP's under the mail.domain.tld domain. This domain is what will be configured to use round-robin. The first time somebody resolves the domain it will resolve to the first IP. The next time somebody resolves the domain, it will be the second IP. The third time somebody resolves the domain, it will be the first IP again. round-robin is NOT random. It is purely cyclic order - evenly distributing load across all IPs.

4) set the cache times for the mail.domain.tld 'A' records to 0. This prevents caching and help assures that the load distribution is properly implemented.
__________________
Send me a private message if you would like me to setup your DNS for you for a price of your choosing. This is the preferred method if your DNS needs to be fixed/setup fast and you don't have the time to bounce messages back and forth on a forum. Also, check out these links:

Whois Direct | DNS Crawler | NS Trace | Compare Free DNS Hosts

Reply With Quote
  #3  
Old August 11th, 2003, 01:24 PM
mullas mullas is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 12 mullas User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> SilentRage

I have to thank you very much for your useful reply.

Although, it seems only to clearify how to properly configure DNS when using round robin along with MX records for incoming mail load balancing.

My question also took starting point at how company's handle the problem that must occure whenever a given client want to fetch his/her e-mail from the POP server specified in their mail client software, as you said, when defining two or more A records for the same domain name, these are visited, not randomly, although I have read this a couple of places, but more in the order of the first client gets the first IP and the second client gets the second IP, and so on.

Imagine this scenario, a company uses both multiple outgoing mail servers(SMTP) and multiple incoming mail servers(POP3) to balance the given load:

Quote:
domain.tld. IN MX 10 mail.domain.tld.
domain.tld. IN MX 20 backup.mailserver.tld.

mail.domain.tld. 0 IN A 10.0.1.1
mail.domain.tld. 0 IN A 10.0.2.1

smtp.domain.tld. 0 IN A 10.0.3.1
smtp.domain.tld. 0 IN A 10.0.4.1


The client then uses mail.domain.tld as his/her incoming mail server and smtp.domain.tld as his/her outgoing mail server. These are, of course, defined in their mail client software.

But if mail are sent to one of the available mail servers, destined for a client, and the client then checks his/her e-mail, the client software would then try to fetch his/her mail, but the software might not end up fetching mail from the exact one that the e-mail was sent to in the first place, because of the load balance feature?

Reply With Quote
  #4  
Old August 11th, 2003, 02:32 PM
SilentRage's Avatar
SilentRage SilentRage is offline
DNS/BIND Guru
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jun 2003
Location: OH, USA
Posts: 4,193 SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 5 Days 14 h 27 m 56 sec
Reputation Power: 77
I don't take too well with multiple questions made at one time... :-( I have a particularly one-track single-tasking mind. ;-) But here we go, on to the next issue:

First I'd like to point out that I hope those "pop" servers specified in the MX records has smtp server as well. Cause smtp clients use mx records to find SMTP servers - not pop3 servers. No software today that I know of looks for pop3 servers via DNS. It is all configured.

But aside of that, you speak of a very real issue - although common. What do administrators do with keeping multiple webservers who fall under a single domain redundant? There are solutions out there that may automate the duplication of part or an entire harddrive's contents between servers. This is so that when you make changes to the content of one server, it is automatically propagated to the rest of the redundant servers. More specifically, when your smtp server saves mail that it recieves and is sent to or used by a pop3 server... there should be an external program which copies the new mail to the other servers. I already predict a fardling mess when a user tries to delete his email from one server, just to have it copied back again from another server. I don't know the specifics of how this type of software works - or how it allows you to configure it to its needs. I'm just presenting you with one theory.

Bada bing, I just came up with another solution. Possibly more practical. Once again you have an external program managing the mail, except now it is completely centralized. All incoming mail is stored on an internal network server. Every time somebody connects to a POP3 server, it access the mail stored on that server. deletes mail from that server. Whatever is required.

A windows solution wouldn't even need an external program. You just have network shares on the centralized mail server, and all dependant mail servers map a drive to that share. This way multiple servers can share the data as if it was stored locally on their drive. Linux computers could have samba installed so that they can make use of shares. Or perhaps you can use some other protocol and mount the connection in windows shares-like fashion.

Ah well, I'm plumb out of ideas. I've never actually seen or researched a business solution like this put into action. I've just got my imagination to work off of here.

Reply With Quote
  #5  
Old August 11th, 2003, 03:04 PM
mullas mullas is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 12 mullas User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> SilentRage

Apparently, I also have a one-track single-tasking mind, because you are of course right regarding SMTP and MX records, my mistake.

Anyway, your answer on how company's may handle the mentioned issue, was exactly what I was looking for. And as you mention yourself, the most optimal solution might/should be something like a central server holding all of the e-mail?

To conclude this/these question(s), thank you very much, yet again!

By the way, I also said something about reading somwhere, that using multiple CNAME records to point to multiple A records, could be somewhat useful? But you corrected me, by letting me know that, _that_ was against RFC standards? I found this example in the Apache URL Rewritting Guide:

Quote:
The simplest method for load-balancing is to use the DNS round-robin feature of BIND. Here you just configure www[0-9].foo.com as usual in your DNS with A(address) records, e.g.

www0 IN A 1.2.3.1
www1 IN A 1.2.3.2
www2 IN A 1.2.3.3
www3 IN A 1.2.3.4
www4 IN A 1.2.3.5
www5 IN A 1.2.3.6

www IN CNAME www0.foo.com.
www IN CNAME www1.foo.com.
www IN CNAME www2.foo.com.
www IN CNAME www3.foo.com.
www IN CNAME www4.foo.com.
www IN CNAME www5.foo.com.

Notice that this seems wrong, but is actually an intended feature of BIND and can be used in this way. However, now when www.foo.com gets resolved, BIND gives out www0-www6 - but in a slightly permutated/rotated order every time. This way the clients are spread over the various servers. But notice that this not a perfect load balancing scheme, because DNS resolve information gets cached by the other nameservers on the net, so once a client has resolved www.foo.com to a particular wwwN.foo.com, all subsequent requests also go to this particular name wwwN.foo.com. But the final result is ok, because the total sum of the requests are really spread over the various webservers.

(http://httpd.apache.org/docs/misc/rewriteguide.html)


But the guide examples also state, that it isn't a good practice to use round robin that way? Again, thank you!

Reply With Quote
  #6  
Old August 11th, 2003, 04:11 PM
SilentRage's Avatar
SilentRage SilentRage is offline
DNS/BIND Guru
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jun 2003
Location: OH, USA
Posts: 4,193 SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 5 Days 14 h 27 m 56 sec
Reputation Power: 77
I've brought back a topic to the top that I wrote a bit ago called "Things to remember when defining your zones"

It touches on several points including the multi CNAME issue. It boasts explanations why and references to material to back me up. Not that I think you don't believe me, but just so you make completely educated choices with something besides heresay if ever you need to "correct" someone else. :-)

But yeah, centralized all the way man. I positively hate my first idea.

Last edited by SilentRage : August 11th, 2003 at 04:18 PM.

Reply With Quote
  #7  
Old October 16th, 2003, 07:32 AM
gdevianne gdevianne is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 4 gdevianne User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
SilentRage,
regarding the second question,
smtp redundancy is intended for external users, making sure that your servers will always be reached.
now, administrators can use those smtp servers to just relay email from WAN to LAN.
so, email sent to URL might arrive to any of your smtp server and be directly relayed to a third smtp server that is your mailbox repository ( this through SMTP).
The third server being also the POP server.

In case of high traffic, I would actually put 2 SMTP servers and dedicate them to receive and send email (SMTP). Then, emails addressed to my users would be delivered to a third server for repositoy and POP retrieval.

I do not have an extended knowledge of mail systems, but Lotus Domino is a server that can manage that very easily.

Thanks for the DNS clarification..
gud

Reply With Quote
  #8  
Old October 16th, 2003, 11:32 AM
SilentRage's Avatar
SilentRage SilentRage is offline
DNS/BIND Guru
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jun 2003
Location: OH, USA
Posts: 4,193 SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 5 Days 14 h 27 m 56 sec
Reputation Power: 77
By all means if you know of programs that makes the first option I gave viable and convenient and such, then use them. Do you have any recommendations on such software so that other people who read this post can be pointed in the right direction?

Thanks for your reply.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationDNS > MX load balancing using round robin method?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway