Move all (almost all) Go files in middleware into their own packages. This makes for better naming and discoverability. Lot of changes elsewhere to make this change. The middleware.State was renamed to request.Request which is better, but still does not cover all use-cases. It was also moved out middleware because it is used by `dnsserver` as well. A pkg/dnsutil packages was added for shared, handy, dns util functions. All normalize functions are now put in normalize.go |
||
---|---|---|
.. | ||
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