Commit Graph

1057 Commits

Author SHA1 Message Date
Miek Gieben
23526aec1d core: drop invalid packets (#1123)
We can still be on the receiving end of invalid packet. Drop them
here.
2017-09-29 22:27:40 +01:00
Thong Huynh
2f9c42d82e Enable dnstap plugin to insert other plugin's specific data into extra field of tap.Dnstap message (#1101)
* Add custom data into dnstap context

* Fix error and fix UT compile errors

* Add UTs

* Change as per review comments.  Use boolean to indicate which Dnstap message to send out

* Merge with master and fix lint warning

* Remove newline

* Fix review comments
2017-09-29 16:38:01 -04:00
Chris O'Haver
4b3a430ff2 plugin/kubernetes: Enable protobuf, Update client api package (#1114)
* vendor

* code
2017-09-29 15:58:50 -04:00
varyoo
45b0252c1a plugin/dnstap: don't spam Travis + valid dnstap payload (#1121)
* don't spam Travis + valid dnstap payload

* log instead of fmt

* Revert "log instead of fmt"

This reverts commit 88f09c3939.

* log the right way

* log the final way

* minor enhancements
2017-09-29 20:29:33 +01:00
Miek Gieben
1e71d0e2c1 plugin/cache: don't cache msg with TTL=0 in them (#1116)
Don't cache these - may be lead to weird side effects.

Fixes #1113
2017-09-28 14:22:23 +01:00
Miek Gieben
9d736fd754 test: remove -v output of test_readme.go (#1115)
Only output when something is wrong, not by default when you just run
with -v.

Cleans the test output a little.
2017-09-28 09:46:41 +01:00
Miek Gieben
44a0cb9557 test: fix zone file (#1112)
* test: fix zone file

Add missing $TTL 3600 as the top.

Recent change in Go DNS made this mandatory - old behavior wasn't
standards compliant.

* and here
2017-09-26 19:41:49 +01:00
varyoo
daf8ef0da8 Adds the dnstap I/O routines and should fix some issues (#1083)
* adds the dnstap I/O thread and should fix a lot of mistakes

* docs

* -race test

* oops

* docs
2017-09-26 11:45:33 -04:00
Miek Gieben
2a32cd4159 plugin/proxy: decrease health timeouts (#1107)
Turn down the timeouts and numbers a bit:
FailTimeout 10s -> 5s
Future 60s -> 12s
TryDuration 60s -> 16s
The timeout for decrementing the fails in a host: 10s -> 2s

And the biggest change: don't set fails when the error is Timeout(),
meaning we loop for a bit and may try the same server again, but we
don't mark our upstream as bad, see comments in proxy.go. Testing this
with "ANY isc.org" and "MX miek.nl" we see:

~~~
::1 - [24/Sep/2017:08:06:17 +0100] "ANY IN isc.org. udp 37 false 4096" SERVFAIL qr,rd 37 10.001621221s
24/Sep/2017:08:06:17 +0100 [ERROR 0 isc.org. ANY] unreachable backend: read udp 192.168.1.148:37420->8.8.8.8:53: i/o timeout

::1 - [24/Sep/2017:08:06:17 +0100] "MX IN miek.nl. udp 37 false 4096" NOERROR qr,rd,ra,ad 170 35.957284ms

127.0.0.1 - [24/Sep/2017:08:06:18 +0100] "ANY IN isc.org. udp 37 false 4096" SERVFAIL qr,rd 37 10.002051726s
24/Sep/2017:08:06:18 +0100 [ERROR 0 isc.org. ANY] unreachable backend: read udp 192.168.1.148:54901->8.8.8.8:53: i/o timeout

::1 - [24/Sep/2017:08:06:19 +0100] "MX IN miek.nl. udp 37 false 4096" NOERROR qr,rd,ra,ad 170 56.848416ms
127.0.0.1 - [24/Sep/2017:08:06:21 +0100] "MX IN miek.nl. udp 37 false 4096" NOERROR qr,rd,ra,ad 170 48.118349ms
::1 - [24/Sep/2017:08:06:21 +0100] "MX IN miek.nl. udp 37 false 4096" NOERROR qr,rd,ra,ad 170 1.055172915s
~~~

So the ANY isc.org queries show up twice, because we retry internally -
this is I think WAI.

The `miek.nl MX` queries are just processed normally as no backend is
marked as unreachable.

May fix #1035 #486
2017-09-24 20:05:36 +01:00
Miek Gieben
148a99442d healhcheck: various cleanups (#1106)
* healhcheck: various cleanups

Network wasn't used. IgnorePaths wasn't used. Move checkdown function to
common function shared between proxy protocols. And some naming fixed.

Also reset the Fails on a succesful healthcheck back to 0.

remove newlines from log

* compile

* fix test
2017-09-24 19:37:43 +01:00
Yong Tang
102cfbd7fe Use gometalinter and enforcing go fmt/lint/vet (#1108)
* Use gometalinter and enforcing go fmt/lint/vet

Before this PR go fmt is enabled, go lint is suggest only.
From time to time we have to manually check for go lint and go vet
for any issues.

This fix uses gometalinter and enforcing go fmt/lint/vet.
Several reasons:
- gometalinter could handle multiple linters concurrently
- gometalinter supports suppression with `// nolint[: <linter>]`

Previously one reason we didn't enable go lint was due to the
```
warning: context.Context should be the first parameter of a function (golint)
```
this is now possible with gometalinter and `// nolint: golint` (See changes).

This fix also discovered several go vet issues and fixes it.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Fix several issues reported by gometalinter (go vet)

This commit fixes several issues reported by gometalinter (go vet).

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Increase deadline

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-09-24 11:59:04 +01:00
Yong Tang
387ceb480b go lint/vet/misspell cleanup (#1105)
This fix address several issues related to golint/vet/misspell.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-09-22 16:13:04 -07:00
John Belamaric
6f19dda0b4 Fix autopath crash when pods verified not enabled (#1099) 2017-09-21 18:06:35 +01:00
Miek Gieben
284061eee7 pkg: add dnstest (#1098)
Add a full test server impl in this new package + tests. Move
dnsrecorder into this package as well and finish up the commented out
tests that were left in the old dnsrecorder package.

Update all callers and tests.
2017-09-21 15:15:47 +01:00
Yong Tang
7109c6715c Add inline support for middleware/hosts (#1072)
This fix add inline support for middleware/hosts so that
it is possible to specify hosts file insides the Corefile:
```
hosts inline example.org {
    10.0.0.1 example.org
    fallthrough
}
```

This fix fixes 999.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-09-21 04:18:13 -07:00
Damian Myerscough
aecf916377 Fixing a small typo (#1097) 2017-09-21 07:22:13 +01:00
Thong Huynh
ec21f83425 Modify the rewrite plugin to write multiple EDNS0 options (#936) (#1096)
* Add processing mode

* Add processing mode

* Update UTs

* Update README.md

* Change to use the constant Stop

* Fix README per review comments
2017-09-20 16:06:53 -04:00
Miek Gieben
36c7aa6437 plugin/{file,auto}: drop fsnotify (#1090)
* plugin/{file,auto}: drop fsnotify

Reload every minute. This is more deterministic then fsnotify. Also
other thing cropped up: sharing zone files between zone; there is only
1 fsnotify event and we need to fan out the reload to all zone files.
This is a large rewrite (which could still be done), for now, poll the
zone file on disk.

Give serial no change a special error type so we can check for this.
Improve the logging for reloading:

2017/09/19 07:34:39 [INFO] Successfully reloaded zone "miek.nl." in "db.miek.nl" with serial 128263060
2017/09/19 07:34:45 [INFO] Successfully reloaded zone "miek.nl." in "db.miek.nl" with serial 128263059
2017/09/19 07:34:51 [INFO] Successfully reloaded zone "miek.nl." in "db.miek.nl" with serial 128263060

Fixes #1013

* typo
2017-09-20 17:28:23 +01:00
Miek Gieben
cd5879f866 plugin/cache: cap TTL on first answer (#1092)
Cache would let the first response through and would then cap subsequent
ones to whatever the cache duration was. This would lead to huge drops
in TTL values: 3600 -> 20 for instance, which is not only bad, but can
mess up your careful TTL planning business.

This PR fixes that and applies the cache duration to all replies. As a
bonus I could remove a time.Sleep() from the cache test and just check
for the cache duration as the TTL on the reply.

Fixes #1038
2017-09-20 11:36:41 +01:00
Miek Gieben
be47709270 More Middleware -> Plugin conversions (#1088)
Forgot about these.
2017-09-16 14:13:28 +01:00
Yong Tang
6f874f0bd1 Add Pull Request templates (#1086)
This fix adds a Pull Request templates to be used.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-09-15 23:53:18 +01:00
Miek Gieben
f0837d9637 cleanup readme (#1087) 2017-09-15 23:49:20 +01:00
Yong Tang
c79a4769e4 golint cleanup (#1085)
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-09-15 23:34:02 +01:00
Miek Gieben
2388e36c2c plugin: README.md updates (#1084)
updates so the look better on coredns.io
2017-09-15 22:27:55 +01:00
Miek Gieben
19d7d207d3 Make proxy examples better (#1080) 2017-09-15 11:30:10 +01:00
Miek Gieben
8e8ce6c3e1 core: check for gh-release (#1079)
Stop when this can't be found early on.

Fixes #1053
2017-09-15 09:56:20 +01:00
Miek Gieben
ae9cae67e3 plugins: expand examples (#1077)
* plugins: expand examples

Expand some examples and test them by annotating it with `corefile`

* Can't start kubernetes

* Can test pprof :(
2017-09-15 09:56:05 +01:00
Miek Gieben
74f9dc6c00 core: Remove AddMiddleware (#1076)
This does not help to make it backwards compatible. The middleware ->
plugin rename invalidates all this. External middleware won't compile
either way.
2017-09-14 21:56:54 +01:00
Miek Gieben
d8714e64e4 Remove the word middleware (#1067)
* Rename middleware to plugin

first pass; mostly used 'sed', few spots where I manually changed
text.

This still builds a coredns binary.

* fmt error

* Rename AddMiddleware to AddPlugin

* Readd AddMiddleware to remain backwards compat
2017-09-14 09:36:06 +01:00
Yong Tang
b984aa4559 Update documentation README.md for building coredns with docker (#1073)
* Update documentation README.md for building coredns with docker

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Update README.md

* Update README.md
2017-09-13 16:36:20 -07:00
John Belamaric
deca1a2cc2 remove go 1.9 restriction, which is false 2017-09-13 17:28:07 -04:00
Chris West
0fc4a89544 Add non-Go-user friendly build instructions (#1071)
Go is not  super helpful if you checkout the code to a random path, then try and follow the build instructions in the README. Add some instructions that help users who don't deal with Go on a day-to-day basis to get it right.

Fixes #1070. Thanks to @johnbelamaric for reminding me about Go's deficiencies.
2017-09-13 17:03:56 -04:00
Miek Gieben
43587e8c50 Update the tls documentation (#1061)
* Update the tls documentation

* cant test corefile because we dont have pem data

* Add note on client support
2017-09-12 14:54:26 +01:00
John Belamaric
b8e5f54de4 Add CII best practices badge (#1062) 2017-09-12 09:38:14 -04:00
Miek Gieben
3e252deabb Remove debug queries (#1058)
* Remove debug from interface and methods

* remove debug queries from etcd

* remove debug queries from k8s - they were not used

* And remove from mw/proxy-google as well

* Remove debug query test
2017-09-12 10:52:43 +01:00
antonkyrylenko
c2105a4f41 Update ADOPTERS.md (#1059)
Add kismia.com  organisation to ADOPTERS.md
2017-09-11 12:33:56 -04:00
John Belamaric
b77ca74b15 Update ADOPTERS.md 2017-09-11 09:41:52 -04:00
Miek Gieben
296c5a0c1c mw/errors: doc (#1057)
Remove the [FILE] option from the docs, we still allow it, but this one
value that we allow now *stdout* isn't shown anymore.

Also test the snippet with readme_test.go by adding `~~ corefile`.
2017-09-11 06:51:24 +01:00
Miek Gieben
176e0916fe mw/chaos: update docs (#1055)
* mw/chaos: update docs

Fix/update the documentation: make the corefile snippets tested and
expand them a little. Show `dig` example.

Fixes #1050

* dot
2017-09-10 21:01:49 +01:00
Miek Gieben
2cff9291e5 mw/whoami: update docs (#1054)
* mw/whoami: update docs

Parse the corefile in the readme_test.go and other tweaks to the docs.

Fixes #1049

* trailing

* remove the 53 port
2017-09-10 20:46:25 +01:00
Miek Gieben
2785f01db5 core: readme test: new port for every instance (#1056)
Use a new port for every instance.
2017-09-10 20:29:38 +01:00
John Belamaric
257889825f Initial adopters list (#1036)
* Initial adopters list

* Remove one until approved

* Fix typo
2017-09-10 19:52:36 +01:00
Miek Gieben
6e3eec1e72 documention: test README snippets (#1043)
If a README has a corefile snippet that is annotated with `corefile`,
this test will parse the instance and checks the snippet is legal.
This means a) we will get better docs b) we know for sure everything
still parses.

The test parses everything in middleware/*/README.md, it does not check
for README presence, just Corefile snippets. The port used is 10053 and
overrides whatever port is set in the docs.

The secondary middleware was used as an example and adds two examples
that should parse.

failures show up as:

~~~
--- FAIL: TestReadme (0.04s)
	readme_test.go:50: Testing ../middleware/secondary/README.md, with 100 byte snippet
	readme_test.go:50: Testing ../middleware/secondary/README.md, with 93 byte snippet
	readme_test.go:53: Failed to start server for input "middleware/secondary: Corefile:3 - Error during parsing: unknown property 'transfeT'":
		. {
		    secondary example.net {
		        transfeT from 10.1.2.1
		        transfer to *
		    }
		}
FAIL
~~~
2017-09-10 19:52:15 +01:00
Miek Gieben
1b60688dc8 Release 011 v011 2017-09-10 19:26:47 +01:00
Miek Gieben
e4170150c7 mw/secondary: more tests in setup_test.go (#1039)
Improve the syntax tests for this middleware.
2017-09-09 11:11:07 +01:00
Thong Huynh
8e5d0a23fa Add EDNS0_SUBNET rewrite (#1022)
* Add EDNS0_SUBNET rewrite

* Fix review comments

* Update comment

* Fix according to review comments

* Add ResponseWriter6 instead of parameterized the existing ResponseWriter
2017-09-08 21:36:09 +01:00
Miek Gieben
bcdc99ab11 mw/etcd: fix 'fallthrough' (#1026)
* mw/etcd: revert 'add fallthrough'

This removes 'fallthrough' for *etcd* which is not needed. This was
added in 00f5c7797 but is totally not needed and creates backwards
incompat behavior even.

Thanks to @johnbelamaric for pointing this out in #925.

* remove here as well

* Revert "remove here as well"

This reverts commit 9d44397827.

* Revert "mw/etcd: revert 'add fallthrough'"

This reverts commit 0cfe3cb1ab.

* mw/{etcd,kubernetes}: use fallthrough correctly

reverts of reverts, will rebase and squash later.
2017-09-07 13:21:37 -04:00
Miek Gieben
594c6d7522 mw/federation: use original qname in all responses (#1033)
Maybe a fix for #1031 ?
2017-09-07 08:47:58 -04:00
Miek Gieben
48806fe8a6 mw/kubernetes: document stubDomain proxy (#1032)
Mention stubdomains in the documentation, give an example  and fix a few
typos.

Fixes #1028
2017-09-07 10:48:26 +01:00
Miek Gieben
9528777fc5 mw/autopath: correct type for type switch (#1029)
* mw/autopath: correct type for type switch

Use pointer to kubernetes as that is what is registered. Fix up
federation which had the same mistake.

* here
2017-09-06 18:28:41 -04:00