coredns/plugin/loadbalance
Miek Gieben f3134da45e
Clean up tests logging (#1979)
* Clean up tests logging

This cleans up the travis logs so you can see the failures better.

Older tests in tests/ would call log.SetOutput(ioutil.Discard) in
a haphazard way. This add log.Discard and put an `init` function in each
package's dir (no way to do this globally). The cleanup in tests/ is
clear.

All plugins also got this init function to have some uniformity and kill
any (future) logging there in the tests as well.

There is a one-off in pkg/healthcheck because that does log.

Signed-off-by: Miek Gieben <miek@miek.nl>

* bring back original log_test.go

Signed-off-by: Miek Gieben <miek@miek.nl>

* suppress logging here as well

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-07-19 16:23:06 +01:00
..
handler.go all: fix plugin import ordering (#1717) 2018-04-22 08:34:35 +01:00
loadbalance.go plugin/loadbalance: add parse and tests (#1947) 2018-07-06 21:49:21 +00:00
loadbalance_test.go all: fix plugin import ordering (#1717) 2018-04-22 08:34:35 +01:00
log_test.go Clean up tests logging (#1979) 2018-07-19 16:23:06 +01:00
OWNERS Add OWNERS file (#1486) 2018-02-08 10:55:51 +00:00
README.md Remove trailing whitespace (#1955) 2018-07-09 08:08:02 -04:00
setup.go plugin/loadbalance: add parse and tests (#1947) 2018-07-06 21:49:21 +00:00
setup_test.go plugin/loadbalance: add parse and tests (#1947) 2018-07-06 21:49:21 +00:00

loadbalance

Name

loadbalance - randomize the order of A, AAAA and MX records.

Description

The loadbalance will act as a round-robin DNS loadbalancer by randomizing the order of A, AAAA, and MX 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, and only option, is "round_robin".

Examples

Load balance replies coming back from Google Public DNS:

. {
    loadbalance round_robin
    forward . 8.8.8.8 8.8.4.4
}