coredns/middleware/loadbalance
Miek Gieben d1f17fa7e0 Cleanup: put middleware helper functions in pkgs (#245)
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
2016-09-07 11:10:16 +01:00
..
handler.go Cache (#126) 2016-04-19 11:13:24 +01:00
loadbalance.go Some tiny changes and new benchmark test function (#136) 2016-04-26 20:45:29 +01:00
loadbalance_test.go Cleanup: put middleware helper functions in pkgs (#245) 2016-09-07 11:10:16 +01:00
README.md Update README.md 2016-08-22 14:25:19 -07:00
setup.go Make CoreDNS a server type plugin for Caddy (#220) 2016-08-19 17:14:17 -07:00

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