mirror of
https://github.com/coredns/coredns.io.git
synced 2026-10-19 16:15:37 +00:00
Update fanout explugin doc (#310)
Signed-off-by: Gleb Kogtev <gleb.kogtev@gmail.com>
This commit is contained in:
@@ -4,15 +4,14 @@ description = "*fanout* - parallel proxying DNS messages to upstream resolvers."
|
||||
weight = 10
|
||||
tags = [ "plugin" , "fanout" ]
|
||||
categories = [ "plugin", "external" ]
|
||||
date = "2020-03-13T10:00:00+08:00"
|
||||
date = "2024-09-03T22:00:00+08:00"
|
||||
repo = "https://github.com/networkservicemesh/fanout"
|
||||
home = "https://github.com/networkservicemesh/fanout/README.md"
|
||||
+++
|
||||
|
||||
## Description
|
||||
|
||||
*fanout* Each incoming DNS query that hits the CoreDNS fanout plugin will be replicated in parallel to each listed IP (i.e. the DNS servers).
|
||||
The first non-negative response from any of the queried DNS Servers will be forwarded as a response to the application's DNS request.
|
||||
Each incoming DNS query that hits the CoreDNS fanout plugin will be replicated in parallel to each listed IP (i.e. the DNS servers). The first non-negative response from any of the queried DNS Servers will be forwarded as a response to the application's DNS request.
|
||||
|
||||
## Syntax
|
||||
|
||||
@@ -30,9 +29,17 @@ The first non-negative response from any of the queried DNS Servers will be forw
|
||||
(Cloudflare) will not work.
|
||||
|
||||
* `worker-count` is the number of parallel queries per request. By default equals to count of IP list. Use this only for reducing parallel queries per request.
|
||||
* `policy` - specifies the policy of DNS server selection mechanism. The default is `sequential`.
|
||||
* `sequential` - select DNS servers one-by-one based on its order
|
||||
* `weighted-random` - select DNS servers randomly based on `weighted-random-server-count` and `weighted-random-load-factor` params.
|
||||
* `weighted-random-server-count` is the number of DNS servers to be requested. Equals to the number of specified IPs by default. Used only with the `weighted-random` policy.
|
||||
* `weighted-random-load-factor` - the probability of selecting a server. This is specified in the order of the list of IP addresses and takes values between 1 and 100. By default, all servers have an equal probability of 100. Used only with the `weighted-random` policy.
|
||||
* `network` is a specific network protocol. Could be `tcp`, `udp`, `tcp-tls`.
|
||||
* `except` is a list is a space-separated list of domains to exclude from proxying.
|
||||
|
||||
* `except-file` is the path to file with line-separated list of domains to exclude from proxying.
|
||||
* `attempt-count` is the number of attempts to connect to upstream servers that are needed before considering an upstream to be down. If 0, the upstream will never be marked as down and request will be finished by `timeout`. Default is `3`.
|
||||
* `timeout` is the timeout of request. After this period, attempts to receive a response from the upstream servers will be stopped. Default is `30s`.
|
||||
* `race` gives priority to the first result, whether it is negative or not, as long as it is a standard DNS result.
|
||||
## Metrics
|
||||
|
||||
If monitoring is enabled (via the *prometheus* plugin) then the following metric are exported:
|
||||
@@ -40,9 +47,6 @@ If monitoring is enabled (via the *prometheus* plugin) then the following metric
|
||||
* `coredns_fanout_request_duration_seconds{to}` - duration per upstream interaction.
|
||||
* `coredns_fanout_request_count_total{to}` - query count per upstream.
|
||||
* `coredns_fanout_response_rcode_count_total{to, rcode}` - count of RCODEs per upstream.
|
||||
* `coredns_fanout_healthcheck_failure_count_total{to}` - number of failed health checks per upstream.
|
||||
* `coredns_fanout_healthcheck_broken_count_total{}` - counter of when all upstreams are unhealthy,
|
||||
and we are randomly (this always uses the `random` policy) spraying to an upstream.
|
||||
|
||||
Where `to` is one of the upstream servers (**TO** from the config), `rcode` is the returned RCODE
|
||||
from the upstream.
|
||||
@@ -107,6 +111,36 @@ Sends parallel requests between five resolvers via UDP uses two workers and with
|
||||
}
|
||||
~~~
|
||||
|
||||
Multiple upstream servers are configured but one of them is down, query a `non-existent` domain.
|
||||
If `race` is enable, we will get `NXDOMAIN` result quickly, otherwise we will get `"connection timed out"` result in a few seconds.
|
||||
~~~ corefile
|
||||
. {
|
||||
fanout . 10.0.0.10:53 10.0.0.11:53 10.0.0.12:53 10.0.0.13:1053 10.0.0.14:1053 {
|
||||
race
|
||||
}
|
||||
}
|
||||
~~~
|
||||
|
||||
Sends parallel requests between two randomly selected resolvers. Note, that `127.0.0.1:9007` would be selected more frequently as it has the highest `weighted-random-load-factor`.
|
||||
~~~ corefile
|
||||
example.org {
|
||||
fanout . 127.0.0.1:9005 127.0.0.1:9006 127.0.0.1:9007 {
|
||||
policy weighted-random
|
||||
weighted-random-server-count 2
|
||||
weighted-random-load-factor 50 70 100
|
||||
}
|
||||
}
|
||||
~~~
|
||||
|
||||
Sends parallel requests between three resolver sequentially (default mode).
|
||||
~~~ corefile
|
||||
example.org {
|
||||
fanout . 127.0.0.1:9005 127.0.0.1:9006 127.0.0.1:9007 {
|
||||
policy sequential
|
||||
}
|
||||
}
|
||||
~~~
|
||||
|
||||
## Also See
|
||||
|
||||
See the [fanout](https://github.com/networkservicemesh/fanout).
|
||||
Reference in New Issue
Block a user