* feat: Support zonefile configuration for custom dns mapping
* docs: Update configuration.md
* Rename var to ok
* Linter fixes
* Remove hashes in test describe description
* Implement PR comments; zoneFileMapping -> zone, initialize with proper sizes
* Remove custom CNAME parsing
* Utilize TTL defined in zone file
* Link to wikipedia's example file
* Test to confirm that a relative zone entry without an $ORIGIN returns an error
* Write a test covering the $INCLUDE directive
* Write a test confirming that a dns zone can result in more than 1 RR
* Linting
* fix: Use proper matchers in CustomDNS Zone tests; Update configuration.md description
* Pull in config directory to support relative $INCLUDE
* Added tests to ensure the ability to use both bare filenames as well as relative filenames when using the $INCLUDE directive
* Shorten test description (Linting error)
* Move Assignment of z.RRs to the end of the UnmarshallYAML function
* Moved tests for relative $INCLUDE zones to config_test. Added test case when config param passed to blocky is a directory
* Corrected test case to _actually_ test againt bare file names
Replaces `startVerifyUpstream` and behaves just like
`blocking.loading.strategy`.
We use the bootstrap resolver for any requests that arrive before the
upstreams are initialized.
Move `startVerifyUpstream` to `upstreams.startVerify` so it's accessible
via `UpstreamGroup` and we don't need to pass `startVerify` to all
resolver constructors that call `NewUpstreamResolver`.
Also has the nice benefit of greatly reducing the usage of `GetConfig`.
* Add maxErrorsPerFile blocking configuration
The default max errors per file of 5 is too small IMHO.
This commit makes this number user-configurable.
* squash: fix lint
* squash: docs
* squash: change type to int to allow -1
* squash: test that the `maxErrorsPerFile` is actually used
---------
Co-authored-by: ThinkChaos <ThinkChaos@users.noreply.github.com>
To declutter the global top level config options i propose the grouping of ports and logging options as child options of top level options.
New structure:
ports:
dns: 43
http: 4000
https: 4443
tls: 853
log:
level: warn
format: json
privacy: true
timestamp: false
* Enable start if one upstream resolver fails
* Will now check if upstream actually works
* Fixed default upstream in some tests
* Increase timeouts in some tests
* change default value of "StartVerifyUpstream" to false
Co-authored-by: Dimitri Herzog <dimitri.herzog@gmail.com>
This commit extracts rewriting logic from `ConditionalUpstreamResolver`
into the new `RewriterResolver`, and uses that to enable rewriting for
the `CustomDNSResolver`.
`RewriterResolver` wraps a resolver and applies the rewrite to the
request that is forwarded to the inner resolver.
It also introduces a new optional interface: `NamedResolver`.
This allows a `Resolver` to choose what its user friendly name is,
instead of always being its type name.