bind round robin

Fred Clift fred at clift.org
Tue Sep 19 05:25:54 PDT 2006


On Tue, Sep 19, 2006 at 02:00:23PM +0800, pinoyskull wrote:

 >> One of my client's domain has multiple IPs for redundancy, i configured
 >> his www as such
 >>
 >> www        IN A   10.10.10.10
 >> www        IN A   192.168.0.10
 >>
 >> Is there a way to prioritize 10.10.10.10 over 192.168.0.10? How do i
 >> configure it?


I missed the original question about this but if you're really 
interested in doing somethign in software  rather than buying some kind 
of load-balancing hardware, then you could write your own (simple) 
backend for powerdns.

powerdns is in ports and it has a simple "pipe" interface to the daemon 
that would let you write your own "proporitional-share" dns responder 
for some set of RRs.

Check out the geographic load balancing that the blitzed.org guys use...

http://wiki.blitzed.org/DNS_balancing

Basically, you would delegate a subdomain (bar.example.org) to the 
server running your custom powerdns config and all lookups of 
foo.bar.example.org would end up at your server, where your custome (20 
or 60 lines of perl) powerdns module could return which ever of the two 
IPs you prefer, either statistically, or based on some kind of remotely 
fetched load average, ping time, other-availibility-metric, etc.

So, say you wanted 80% of your traffic to go to the primary box, then 
you turn off caching in your powerdns config file and have your pipe'd 
child return the primary IP 8 times for every 2 times you return the ip 
of the other box etc.  Or always return the primary server unless it is 
having problems, in which case you return the secondary.  Of course you 
want the TTL on these records, or perhaps the delegated subdomain to be 
low so the client doesn't cache it much.

I'm currently got a geo-balanced test setup I've been playing with - it 
returns CNAMES to XX.clift.org for any lookup of test.geo.clift.org, 
where XX are theoreticaly country codes based on what IP addresses you 
make the requests from.  The quality of the free geo-ip info isn't 
great, but at least it gets you on the right continent.  The geo-ip data 
is 'free' via rsync from countries.nerd.dk - see 
http://countries.nerd.dk/more.html for more information

Anyway, it'd take a bit of work, but would be doable.

Fred Clift
fred 'AT' clift <dot> org


More information about the freebsd-stable mailing list