How to do DNS round robin with different weight

Kevin Darcy kcd at daimlerchrysler.com
Tue Apr 17 20:23:52 UTC 2007


skybirrd at aol.com wrote:
> Hello members,
>
> I'm running BIND-9.3.2. I add these items to do the DNS round-robin:
>
> bbs    61.143.0.1
>          61.143.0.2
>
>
> Then the internet accesses would go to both IPs averagely.
>   
Averagely?
> But if I need to drive more traffic to the first IP,I may need to set 
> different weight for both IPs.
> How can I set this weight in Bind?
>
>   
No, you can't do this with A records in stock BIND, except maybe with 
some old and/or buggy versions that didn't strip duplicate records properly.

If you want weighting you need to a) hack BIND, b) use a client that 
supports SRV records (which has "weighting" functionality built in), or 
c) have something other than BIND serving up the address records (e.g. 
any number of commercial load-balancing products).

Note that even if you manage to "weight" your A records, unless you 
control the "weighting" configuration of all resolvers that are going to 
be used by all clients that access your app, your careful plans may be 
undone by caching resolvers in between the clients and your nameservers, 
which may re-sort the records randomly or based on some configuration of 
their own. The only way to partially overcome this drawback is to set 
your TTLs artificially low (thus defeating caching to some degree), but 
this can be considered anti-social because you're making everyone else's 
nameservers work harder than they need to.

- Kevin




More information about the bind-users mailing list