* plugins: Return error for multiple use of some
Return plugin.ErrOnce when a plugin that doesn't support it, is called
mutliple times.
This now adds it for: cache, dnssec, errors, forward, hosts, nsid.
And changes it slightly in kubernetes, pprof, reload, root.
* more tests
Rename the constants to IP4arpa and IP6arpa (shorter and exported) and
make IsReverse return the type of the reverse zone which could be handy
for some callers.
Also add tests for IsReverse()
This fix updates go dep with `dep ensure --update` as well as the following:
- Removed github.com/ugorji/go restriction in Gopkg.toml (fixes #1557)
- Added github.com/flynn/go-shlex in Makefile (neede by Caddy, maybe removed later)
This fix fixes#1557
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* add OverlapChecker, move the test of overlap AFTER the directive setup process, change key of configs to allow multiple same key
* glitch when rebase. init of Config should include the default host
* add tests for the registering of configuration
rename multicast in 'unbound'.
add comments on the validator
* - merged zoneAddr and addrKey that are very similar
- move maps of Validator to zoneAddr, avoinding need to have string representation of zoneaddr
- moving key build for saving Config at Config side instead of dnsContext
* - UT on saving config is now useless.
* - cannot cleanup access to Configs after setup. Deferred function to Start, use it
* - cleanup register unit tests. remove useless function
* - address comments of review. name of validator, comments, simplify registerAndCheck
* - fixes after review. renaming a function and a comment
* doc: some function/vars/const/package level updates
Various update that stood out while reading godoc.org for CoreDNS.
* Fix some misspellings as well
This fix updates golang.org/x/net to release-branch.go1.10
and golang.org/x/text to v0.3.0, for the purpose of
align with go version 1.10.
This fix also updates README.md to promote using go 1.10.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Use binary search to find the minimal message size, that contains whole
RRs and fits the client's buffer. This is better then just setting
entire sections to `nil`. Extend the tests to test for additional and
answer section truncation. In the first case we *don't* set the TC bit.
This function now also set Compression to true.
* go 1.10: update travis and gofmt
fmt now complains about on file tls_test.go, fix that. Also remove
gofmt, as goimports also checks, so this was done twice.
Put go 1.9 and 1.10 in travis for the time being.
* goimports optional
* Revert "pkg/typify: empty messages are OtherError (#1531)"
This reverts commit fc1d73ffa9.
* plugin/cache: add failsafeTTL
If we can not see what TTL we should put on a message to be cached, use
5 seconds as minimal TTL. We used to apply the maximum TTL to these
messages.
Messages with nothing in them are considered OtherError, they can not
serve any purpose for normal clients (i.e. dyn update or notifies might
have a use for them).
Also update a test in the cache plugin, so that we explicitaly test for
this case.
* plugin/forward: on demand healtchecking
Only start doing health checks when we encouner an error (any error).
This uses the new pluing/pkg/up package to abstract away the actual
checking. This reduces the LOC quite a bit; does need more testing, unit
testing and tcpdumping a bit.
* fix tests
* Fix readme
* Use pkg/up for healthchecks
* remove unused channel
* more cleanups
* update readme
* * Again do go generate and go build; still referencing the wrong forward
repo? Anyway fixed.
* Use pkg/up for doing the healtchecks to cut back on unwanted queries
* Change up.Func to return an error instead of a boolean.
* Drop the string target argument as it doesn't make sense.
* Add healthcheck test on failing to get an upstream answer.
TODO(miek): double check Forward and Lookup and how they interact with
HC, and if we correctly call close() on those
* actual test
* Tests here
* more tests
* try getting rid of host
* Get rid of the host indirection
* Finish removing hosts
* moar testing
* import fmt
* field is not used
* docs
* move some stuff
* bring back health_check
* maxfails=0 test
* git and merging, bah
* review
* prevent nil pointer when query frpc client that could not open
* add UT checking we can now safely request DNS query on an invalid hostname, query for gRPC connection
* fix ortograph
* fix format
* fix package declaration, fix UT - grpclogger, use fatalf, build pool with known addresses
* type, useless error check - after review
* Extend bind to allow multiple addresses. UTs added. Changes the log for server starting, adding address when available
* update readme for bind
* fixes after review
* minor fix on readme
* accept multiple BIND directives in blocserver, consolidate the addresses
* fixes after review - format logging server address, variable names
This fix enables goimports check and fixes several imports format
so that the import sections are prettier, e.g.:
```
import (
- "github.com/miekg/dns"
"regexp"
"strconv"
"strings"
+
+ "github.com/miekg/dns"
)
```
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Remove `fallthrough` from the federation example in the README. `fallthrough` isn't needed here and has no effect (federation has an implicit fallthrough for non-federated queries).
It's inclusion is confusing.
Reloading should work (kill -TERM reload the coredns process), but a lot
of plugins can't handle it proper. Disable to reload plugin until we fix
(most) of the plugins
This fix add a test case for case insensitive/preserving with
whoami plugin.
This fix is part of the effort for 1403.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* plugin/kubernetes: axfr
Hook up dynamic SOA serial by setting ResourceEventHandlerFuncs in
dnsController.
Add prototype of returns msg.Services via the Transfer function. Leave
expanding this to RRs out of scope for a bit.
* plugin/kubernetes: axfr
Respond to AXFR queries
* Fixing race condition
* Fixing instantiation of dnstest writer
* Updates from review
Retweak this a little to make it slightly easier to *not* forget this,
but it is hardly perfect. Should probably make it an interface a plugin
can implement and then unblock if we see that interface.