Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/subzerobo/fanout
https://github.com/subzerobo/fanout
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/subzerobo/fanout
- Owner: subzerobo
- License: apache-2.0
- Created: 2023-11-19T21:49:04.000Z (12 months ago)
- Default Branch: master
- Last Pushed: 2023-11-19T21:49:19.000Z (12 months ago)
- Last Synced: 2024-04-03T02:24:28.540Z (8 months ago)
- Language: Go
- Size: 69.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: code-of-conduct.md
Awesome Lists containing this project
README
# fanout
![ci](https://github.com/subzerobo/fanout/workflows/ci/badge.svg) ![push](https://github.com/subzerobo/fanout/workflows/push/badge.svg?branch=master)
## Name*fanout* - parallel proxying DNS messages to upstream resolvers.
## Description
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
* `tls` **CERT** **KEY** **CA** define the TLS properties for TLS connection. From 0 to 3 arguments can be
provided with the meaning as described below
* `tls` - no client authentication is used, and the system CAs are used to verify the server certificate
* `tls` **CA** - no client authentication is used, and the file CA is used to verify the server certificate
* `tls` **CERT** **KEY** - client authentication is used with the specified cert/key pair.
The server certificate is verified with the system CAs
* `tls` **CERT** **KEY** **CA** - client authentication is used with the specified cert/key pair.
The server certificate is verified using the specified CA file
* `tls_servername` **NAME** allows you to set a server name in the TLS configuration; for instance 9.9.9.9
needs this to be set to `dns.quad9.net`. Multiple upstreams are still allowed in this scenario,
but they have to use the same `tls_servername`. E.g. mixing 9.9.9.9 (QuadDNS) with 1.1.1.1
(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.
* `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.
## MetricsIf monitoring is enabled (via the *prometheus* plugin) then the following metric are exported:
* `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.Where `to` is one of the upstream servers (**TO** from the config), `rcode` is the returned RCODE
from the upstream.## Examples
Proxy all requests within `example.org.` to a nameservers running on a different ports. The first positive response from a proxy will be provided as the result.~~~ corefile
example.org {
fanout . 127.0.0.1:9005 127.0.0.1:9006 127.0.0.1:9007 127.0.0.1:9008
}
~~~Sends parallel requests between three resolvers, one of which has a IPv6 address via TCP. The first response from proxy will be provided as the result.
~~~ corefile
. {
fanout . 10.0.0.10:53 10.0.0.11:1053 [2003::1]:53 {
network TCP
}
}
~~~Proxying everything except requests to `example.org`
~~~ corefile
. {
fanout . 10.0.0.10:1234 {
except example.org
}
}
~~~Proxy everything except `example.org` using the host's `resolv.conf`'s nameservers:
~~~ corefile
. {
fanout . /etc/resolv.conf {
except example.org
}
}
~~~Proxy all requests to 9.9.9.9 using the DNS-over-TLS protocol.
Note the `tls-server` is mandatory if you want a working setup, as 9.9.9.9 can't be
used in the TLS negotiation.~~~ corefile
. {
fanout . tls://9.9.9.9 {
tls-server dns.quad9.net
}
}
~~~Sends parallel requests between five resolvers via UDP uses two workers and without attempting to reconnect. The first positive response from a proxy will be provided as the result.
~~~ 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 {
worker-count 2
}
}
~~~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
}
}
~~~