Commit graph

1629 commits

Author SHA1 Message Date
Miek Gieben
f697b33283
return an error for multiple use of some plugins (#1559)
* 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
2018-02-28 18:16:05 -08:00
Miek Gieben
5faa9e7bc1
plugin/log: log remote port addr as well (#1573)
Log the remote's port, for IPv6 addr this means we should enclose the v6
address in brackets; make this the default for 'remote'.
2018-02-28 18:15:12 -08:00
Miek Gieben
74825a46f2 Makefile release: depend on godeps (#1570)
godeps sets the external repos to the correct versions meaning we can
build CoreDNS.
2018-02-28 15:13:46 -05:00
Miek Gieben
928de738dd
Rename reverse zone constants (#1568)
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()
2018-02-28 08:43:19 -08:00
Chris O'Haver
395b614349 plugin/kubernetes: PTR/A reverse query corner cases (#1551)
* better handle non PTR rev zone qrys

* vice versa

* tests

* comment typo

* much cleaner
2018-02-28 07:53:12 -08:00
Yong Tang
3c31011ced Add security report section in README.md (#1566)
This fix adds security report section in README.md

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-27 12:05:40 -05:00
Yong Tang
b1ce9ed6e5 Move to incubating project (#1565)
We are in incubating stage now:
https://lists.cncf.io/g/cncf-toc/topic/result_coredns_moving_to/12935200?p=,,,20,0,0,0::recentpostdate%2Fsticky,,,20,2,0,12935200

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-26 18:01:31 +00:00
Miek Gieben
d9958abc03
doc updates (#1563)
Capatilize coredns in ADAPTERS.md
2018-02-26 14:51:40 +00:00
Tobias Schmidt
fc6559df4b List SoundCloud as adopter (#1562) 2018-02-26 14:16:19 +00:00
Yong Tang
604c0045e7 Update go dep (#1560)
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>
2018-02-23 20:10:34 +00:00
Francois Tur
9047bdf3a0 Allow overlapping Zones if binding addresses are different (#1530)
* 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
2018-02-23 16:54:42 +00:00
Miek Gieben
455040c143
doc: some function/vars/const/package level updates (#1558)
* doc: some function/vars/const/package level updates

Various update that stood out while reading godoc.org for CoreDNS.

* Fix some misspellings as well
2018-02-23 15:02:05 +00:00
John Belamaric
e3b7beab6a
Fix health_checks which should be health_check (#1556) 2018-02-22 18:24:21 -05:00
Miek Gieben
83b5eadb4e Release 1.0.6 2018-02-22 09:07:59 +00:00
Miek Gieben
11c7d519d1 Add - to name and description 2018-02-22 08:55:37 +00:00
Yong Tang
e9c878a0d9 Fix with gofmt -s -w for plugin/tls/tls_test.go (#1552)
to make goreportcard happy

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-22 07:25:55 +00:00
Yong Tang
9194b4c29d Update golang.org/x/net and golang.org/x/text (#1553)
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>
2018-02-22 07:25:40 +00:00
Miek Gieben
074d176f03
Scrub: use binary search (#1543)
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.
2018-02-21 21:13:41 +00:00
Chris O'Haver
aa2302e3f4 incl addtl rrs when computing cache ttl (#1549) 2018-02-21 21:02:49 +00:00
Miek Gieben
96aff9376a
doc: prepare for 1.0.6 release (#1548)
make -f Makefile.doc
2018-02-21 16:39:35 +00:00
Chris O'Haver
a9af519f83 minor readme fix (#1547) 2018-02-21 14:21:04 +00:00
Miek Gieben
bfee92a705
doc: Slight README rewrite (#1546)
Drop prominent placement of SkyDNS, some cleanups
2018-02-21 12:33:22 +00:00
Miek Gieben
22409290d9
Caddy 0.10.11 Fix (#1544)
Caddy 0.10.11 is released. Fix CoreDNS to compile against that version.
This also helps people compiling CoreDNS and go getting non-vendored
deps.
2018-02-21 07:15:57 +00:00
Freddy
86be6d2532 remove coredns-grpc reference and update DnsService link (#1542) 2018-02-19 15:29:20 +00:00
Miek Gieben
05e41c5969
go 1.10: update travis and gofmt (#1541)
* 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
2018-02-18 09:43:56 +01:00
Miek Gieben
8cce06cba1
Type.extra (#1538)
* 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.
2018-02-17 19:45:52 +01:00
Chris O'Haver
9719a47c1b plugin/kubernetes: Add noendpoints option (#1536)
* add noendpoints option

* go fmt
2018-02-16 11:05:52 -05:00
Chris O'Haver
2cad04ec10 plugin/template: add upstream option (#1529)
* add upstream

* docs

* tests
2018-02-16 09:45:25 +01:00
Chris O'Haver
ba573c0f40 plugin/auto/file/secondary: Use new upstream resolver (#1534)
* move file, auto, secondary to new upstream

* include context in request
2018-02-16 09:44:50 +01:00
Miek Gieben
fc1d73ffa9
pkg/typify: empty messages are OtherError (#1531)
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.
2018-02-16 09:43:22 +01:00
Miek Gieben
f10627c1d6
doc: run "make Makefile.doc" (#1535) 2018-02-16 09:26:48 +01:00
Chris O'Haver
dfd72e440f plugin/kubernetes: add namespace watch (#1533)
* add namespace watch

* start ns watch, and add sync check
2018-02-15 14:21:54 -05:00
Miek Gieben
16504234e5
plugin/forward using pkg/up (#1493)
* 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
2018-02-15 10:21:57 +01:00
Miek Gieben
8b035fa938
Fix imports (#1528) 2018-02-14 21:29:00 +01:00
Chris O'Haver
71ee323651 plugin/kubernetes: Add upstream @self and loop count (#1484)
* add upstream @self and loop count

* 1st round of feedback

* allow argless upstream

* update test

* readmes

* feedback
2018-02-14 21:11:26 +01:00
Francois Tur
ee8084a08f Plugin/Proxy - prevent nil pointer when query using a gRPC client that could not dial in (#1495)
* 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
2018-02-14 20:20:27 +01:00
Francois Tur
76455c6a0d Plugin/BIND - extend the syntax to allow multiple addresses (#1512)
* 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
2018-02-14 20:19:32 +01:00
Sandeep Rajan
a0834b1dd5 check DO bit is maintaining status (#1526) 2018-02-14 20:18:02 +01:00
Yong Tang
4e63d0be35 Enable goimports check, and fixes several imports format (#1525)
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>
2018-02-14 10:00:04 -05:00
Chris O'Haver
caf2553d7a fix ptr nxdomain response and test (#1524) 2018-02-13 10:52:56 -05:00
Chris O'Haver
ca5097ca13 reqd changes (#1522) 2018-02-12 14:27:16 -05:00
John Belamaric
bd156dc9d1 Stop noisy modifications (#1517)
* Stop noisy modifications

* Review comments, tests

* More coverage

* vet

* Make it obvious new port name is not a typo
2018-02-09 22:32:52 +00:00
Chris O'Haver
d2bbe0103d kubernetes: Fix Federation example in README (#1515)
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.
2018-02-09 15:40:50 -05:00
Miek Gieben
2e894eb0a2
plugin/reload: disable for now (#1511)
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
2018-02-09 11:30:55 +00:00
Miek Gieben
006ce4d56e
Add Chris back (#1513)
Pinged me, still interested in helping out \o/
2018-02-09 10:48:07 +00:00
Yong Tang
89b6e0bedd Add a test case for case insensitive/preserving with whoami plugin (#1509)
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>
2018-02-08 20:08:03 +00:00
Sandeep Rajan
d0892abc2c add sync for proper termination (#1507) 2018-02-08 13:57:49 -05:00
Brad Beam
6fd954f19c support for zone transfer for kubernetes (#1259)
* 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
2018-02-08 16:11:04 +00:00
Miek Gieben
864f502356
Run go genenerate (#1506)
Forward still wasn't right; run make -f Makefile.doc, as well for good
measure.
2018-02-08 15:00:25 +00:00
Miek Gieben
74a9d28f1b
core: unblock CH class for forward as well (#1498)
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.
2018-02-08 12:59:30 +00:00