[80085] in North American Network Operators' Group

home help back first fref pref prev next nref lref last post

DNS Round Robin

daemon@ATHENA.MIT.EDU (Roy)
Sat Apr 23 17:55:51 2005

Date: Sat, 23 Apr 2005 14:55:22 -0700
From: Roy <garlic@garlic.com>
To: nanog@merit.edu
Errors-To: owner-nanog@merit.edu


Something I seem to have found and wonder if anyone else sees this.

One of my users has been using round robin DNS to attempt to load 
balancing using two IP addresses.  A query for www.whatever gives both 
addresses with a TTL of zero.  One address is obviously less than the 
other numerically.  Subsequent queries show alternating results where 
the first address given switches back and forth.  This is the desired 
result.

Here's where is goes weird.  If I do the queries through a caching NS 
running bind 9.3.0, the order that the addresses is always the same with 
the lower one first which clearly defeats the purpose of the load balancing.

If I specify "rrset-order {order random;};" as an option in the caching 
NS then queries come back with random results.

My theory is as follows.  The query causes the caching NS to get the two 
answers but the software stores them in numerical order.  The default 
for bind is to "round-robin" so it choses the first (and thus the lower 
IP address) as the first value.  Since the TTL is zero, the software 
then discards the data so it never gets to select the second value in 
its robin robin scheme.

Does this sound plausible?  Has anyone else observed this?  Is it a bug 
or a feature?

Roy Engehausen

home help back first fref pref prev next nref lref last post