For some reasons there was a dnsserver/middleware.go that defined the middleware handlers. This code was a repeat from middleware/middleware.go. Removed dnsserver/middleware.go and replaced all uses of dnsserver.Middleware with middleware.Middleware. Added dnsserver/address_test.go to test the zone normalization (and to improve the test coverage). The deleted file will also improve the test coverage :) |
||
---|---|---|
.. | ||
handler.go | ||
loadbalance.go | ||
loadbalance_test.go | ||
README.md | ||
setup.go |
loadbalance
loadbalance
acts as a round-robin DNS loadbalancer by randomizing the order of A and AAAA records in the answer. See Wikipedia about the pros and cons
on this setup.
It will take care to sort any CNAMEs before any address records, because some stub resolver implementations (like glibc) are particular about that.
Syntax
loadbalance [policy]
policy
is how to balance, the default is "round_robin"
Examples
loadbalance round_robin