Commit graph

1025 commits

Author SHA1 Message Date
Yong Tang
584dd87c70
Add route53 plugin ()
* Update vendor

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

* Add route53 plugin

This fix adds route53 plugin so that it is possible to
query route53 record through CoreDNS.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-15 09:59:29 -08:00
Tobias Schmidt
d699b89063 Fix SOA examples in plugin/template README ()
SOA records are returned in the authority section, not as answer.
2018-01-15 13:55:10 +00:00
Yue Ko
1112145f5a Allow graceful restart when using TLS listener ()
The original ServergRPC.Listen() method returns a tls.Listener
when tls protocol is specified. Unfortunate, tls.Listener
does not implement the caddy.Listener interface that is
needed for graceful restart to work.

The change is to have the ServergRPC.Listen() method returns the
inner net.Listener instead. The creation of the tls.Listener
is deferred to the ServergRPC.Serve() method.
2018-01-14 08:09:14 +00:00
Yong Tang
e50c425d67 Add NSID description to README.md. ()
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-13 16:17:59 +00:00
Miek Gieben
05ebfaa36a
plugin/log: add the super useful msg ID into the logs () 2018-01-12 18:03:47 +00:00
Tobias Schmidt
850288ecd7 Allow shuffling/loadbalancing cached responses () 2018-01-11 18:59:56 +00:00
cricketliu
a952c07453 Update README.md ()
Minor textual cleanup.
2018-01-11 18:19:16 +00:00
Tobias Schmidt
f1b280de53 Remove TTL ceiling at 5s in plugin/cache ()
The cache plugin always returned a minimum TTL of 5 seconds, regardless
of the actual TTL of the records. A cache is not authoritative for the
record TTL and should not extend it.
2018-01-11 17:06:49 +00:00
Miek Gieben
da230cd1fa
manpages: regen and really add corefile.5 () 2018-01-11 09:46:40 +00:00
cricketliu
5ac8ab4b45 Update README.md ()
Minor textual cleanup.
2018-01-11 07:32:06 +00:00
cricketliu
3e298d2396 Update README.md ()
More minor textual fixes.
2018-01-11 07:31:52 +00:00
cricketliu
655231a599 Update README.md ()
Fixing a couple of small textual problems.
2018-01-11 07:31:34 +00:00
cricketliu
d15746596f Update README.md ()
Just some textual cleanup:  A few misspellings and a few clarifications.
2018-01-10 15:08:08 -08:00
Yong Tang
949b453472 Update Makefile for git get -u with version ()
The changes in this fix have:
1. checkout master branch of dependencies (non-branch will trigger an error with go get -u)
2. go get -u
3. checkout specific versioon (not necessary a branch).

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-10 20:52:02 +00:00
Miek Gieben
dc6c40740f Release 1.0.3 2018-01-10 19:47:55 +00:00
Yong Tang
2ead19f316
Fix version of go get ()
This fix fixes version fetched from `go get` so
that versions are guarded.

github.com/mholt/caddy              v0.10.10
github.com/miekg/dns                v1.0.3
github.com/prometheus/client_golang v0.8.0
golang.org/x/net                    release-branch.go1.9 (branch)
golang.org/x/text                   e19ae1496984b1c655b8044a65c0300a3c878dd3

This fix fixes 1368.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-10 09:30:28 -08:00
Miek Gieben
b7476d0217
Doc ()
* Constent atx headers

* Regen manual pages
2018-01-10 11:45:12 +00:00
Miek Gieben
48059a6c3e
Overloaded ()
* plugin/health: add 'overloaded metrics'

Query our on health endpoint and record (and export as a metric) the
time it takes. The Get has a 5s timeout, that, when reached, will set
the metric duration to 5s. The actually call "I'm I overloaded" is left
to an external entity.

* README

* golint and govet

* and the tests
2018-01-10 11:41:22 +00:00
Miek Gieben
cced1a4c12
pkg/fall: make Zero and Root vars not funcs ()
These can be just vars. Think that was intended as well.
2018-01-09 22:29:19 +00:00
Miek Gieben
a19ea63d3a
plugin/template: small tweaks ()
Small README updates, and fallthrough fixes (using less code)
2018-01-09 21:48:32 +00:00
Rene Treffer
0091e1c9dc Align plugin/template usage and syntax with other plugins ()
* Align plugin/template usage and syntax with other plugins

* Use new fallthrough logic in plugin/template

* Use zone name normalization for plugin/template

* Test fallthrough parsing in plugin/template

* Rework scoping of match checks

Most matches are not plugin global but per template. The plugin does only a
very rough check while detailed checks are done per-template.

Per template checks include:
- Zones
- Class/Type
- Regex
- Fallthrough

* Remove trailing `.` from fully qualified domain names

* Register template metrics with zone/class/type instead of regex

* Remove trailing fqdn dot from multiple testcases
2018-01-09 21:30:58 +00:00
Miek Gieben
a7590897fb
plugin/proxy: max the number of upstreams ()
* plugin/proxy: max the number of upstreams

Put a max of 15 on the number of upstreams.
2018-01-08 15:03:42 +00:00
Miek Gieben
dd37627e8e
plugin/template: README tweaks ()
* plugin/template: README tweaks

* Go gen it
2018-01-08 13:13:25 +00:00
Rene Treffer
a322d90f6f plugin/template ()
* Add a template plugin

The template plugin matches the incoming query by class, type and regex
and templates a response with go templates.

* Fix go style errors

* Fix template README example

* Fix corefile example in plugin/template

* Clarify plugin/template/README.md

Add more details and external links where needed.

* Fix code issues in plugin/template

* Add template metrics

* Add section and template to template plugin metrics

* Fix style / remove extra newline on go imports

* Fix typo in plugin/template/README.md

* Update README.md

I've change the format a bit in a PR that I merged yesterday.

* Add authority section to plugin/template

* Fix naming of incoming query name in plugin/template/README.md

* Fix doc syntax in plugin/template/README.md

* Add authority section to plugin/template/README.md config overview

* Add metric labels to plugin/template/README.md metrics section

* Use request.Request to pass state to the template matcher
2018-01-08 10:52:25 +00:00
John Belamaric
c59f5f6e86
Simplify plugin/pkg/fall ()
* Simplify plugin/pkg/fall

* Remove unused import

* Fix fall_test

* Get fall coverage to 100% just because

* gofmt. sigh.
2018-01-07 14:51:32 -05:00
Miek Gieben
c6febe6250
Add pkg/fall for Fallthrough ()
* Add pkg/fall for Fallthrough

Move this into it's own package to facilitate tests. Important bug
was fixed: make the names fully qualified.

Add fall package to hosts, reverse, etcd, and fix kubernetes and any
tests. The k8s tests are still as-is, might need a future cleanup.
2018-01-07 16:32:59 +00:00
John Belamaric
84ebbbc722
kubernetes: Add zone filtering to fallthrough ()
* Add zone filtering to fallthrough

* Doh. gofmt

* Update documentation
2018-01-06 14:52:09 -05:00
Miek Gieben
75a8a17da4
plugin/kubernetes: fix pod insecure mode ()
Fixes 
2018-01-06 15:56:54 +00:00
Miek Gieben
a8e268e33b
doc: add corefile(5) manual page () 2018-01-06 15:53:33 +00:00
Miek Gieben
a91cd9c428
plugin/kubernetes: add explicit non-existing ns check ()
We already do the right thing here, but add a test none-the-less.
2018-01-05 17:53:26 +00:00
Miek Gieben
f62189372a
plugin/kubernetes: partial fix for crazy pod queries ()
This is probably the first in a series to fix "crazy" pod queries.
If the namespace doesn't exist return NXDOMAIN.

It might be worth extending this 1:1 to findServices as well.
2018-01-05 17:48:08 +00:00
Miek Gieben
58221f55db
Manual pages ()
* Add manual pages

Generate manual pages from the README and extend README with Name and
Description sections.

The generation requires 'ronn' which may not be available. Just check in
all generated manual pages.
2018-01-04 12:53:07 +00:00
Yong Tang
0600f8c058 Add docker pulls badge as we passed 2M pulls ()
We passed 2M docker pulls from DockerHub. Adds `docker pulls` badge
to README.md

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-03 15:03:29 +00:00
Yong Tang
5904345e4c Increase codecov target requirement to 50% (from 40%) ()
It looks like our code coverage is above 50% now. Let's
make it a requirement to prevent it from regress.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-03 14:48:39 +00:00
Miek Gieben
311af9314d
plugin/dnssec: implement shotgun from CloudFlare ()
* plugin/dnssec: implement shotgun from CloudFlare

Put a whole bunch of types in the NSEC bitmap and remove the one that's
being asked for.

Add more records for queries to the apex, SOA, DNSKEY, MX.
2018-01-03 11:11:56 +00:00
Yong Tang
7fe5b0bb1f Update k8s client-go to v6.0.0 ()
* Update k8s client-go to v6.0.0

This fix updates k8s client-go to v6.0.0 as CoreDNS is supported
in 1.9 and v6.0.0 is the recommended version.

There are quite some massive changes that need to be made:
1. k8s.io/client-go/pkg/api/v1 has been changed to k8s.io/api/v1 (repo changed from `client-go` to `api`)
2. kubernetes.Clientset adds one extra layer, so that `kubernetes.Clientset.Services()` and like has been changed to `kubernetes.Clientset.CoreV1().Services()`

Also, we have to stick with specific commits of `k8s.io/apimachinery` and the newly introduced `k8s.io/api`
because go dep still could not figure out the right version to fetch.

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

* Update vendor with `dep ensure --update` and `dep prune`

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-03 11:11:28 +00:00
Miek Gieben
bce7f5fbec Release 1.0.2 2017-12-31 09:14:49 +00:00
Miek Gieben
90dd4bbd45
metrics: correctly register all metrics ()
After initial startup, see if prometheus is loaded and if so, register
our metrics with it.
Stop doing the init() func and just use the sync.Once so we don't double
registrer our metrics.
2017-12-27 15:48:14 +00:00
Max Schmitt
5ac42ed5c2 Added files to .gitignore () 2017-12-27 14:54:35 +00:00
Miek Gieben
8ec89aa4e9
Stop vendoring prometheus ()
* Stop vendoring prometheus

* Fix make
2017-12-27 14:15:03 +00:00
Miek Gieben
99047aee9b
plugin/metrics: convience MustRegister function ()
This leave most of the code intact, but we need to stop vendoring
prometheus, because, again, plugins what want to use it. Not vendoring
prometheus makes my forward metrics show up again. Code looks bit
convoluted, but works:

~~~
	c.OnStartup(func() error {
		once.Do(func() {
			m := dnsserver.GetConfig(c).Handler("prometheus")
			if m == nil {
				return
			}
			if x, ok := m.(*metrics.Metrics); ok {
				x.MustRegister(RequestCount)
				x.MustRegister(RcodeCount)
				x.MustRegister(RequestDuration)
				x.MustRegister(HealthcheckFailureCount)
				x.MustRegister(SocketGauge)
			}
		})
	})
~~~
2017-12-27 14:14:53 +00:00
Miek Gieben
c655589fa3
core: Fix no handler crash ()
If you have no handlers for any zone CoreDNS would crash, this is very
*uncommon*, because it makes your server a bit unusable. Example config:
~~~
. {
    #forward . tls://9.9.9.9 8.8.8.8 {
    #    health_check 5s
    #    tls_servername dns.quad9.net
    #}
    pprof
    debug
}
~~~
It this does nothing and doesn't setup you plugin chain because pprof and
debug don't handle queries
2017-12-22 08:55:35 +00:00
Miek Gieben
1f81d154ed
dnstest: add multirecorder ()
* dnstest: add multirecorder

This adds a new recorder that captures all messages written to it. This
can be useful when, for instance, testing AXFR which can write muliple
messages back to the client.

* docs
2017-12-22 08:54:27 +00:00
Francois Tur
08076e5284 Update Makefile.release () 2017-12-21 15:47:09 +00:00
Miek Gieben
0221f3d83c Makefile.release: allow for other docker registries ()
Default to empty DOCKER var so you wont accidently push to the
production dockerhub. But allow to be overriden to you can push
to your registry. This allows you to re-use the CoreDNS makefiles for
your internal CI/CD.

Hacked Makefile with echos:

make DOCKER=bla -f Makefile.release docker-push
Pushing: 1.0.1
for arch in amd64 arm arm64 ppc64le s390x; do \
    echo docker push bla/coredns:coredns-$arch ;\
done
docker push bla/coredns:coredns-amd64
docker push bla/coredns:coredns-arm
docker push bla/coredns:coredns-arm64
docker push bla/coredns:coredns-ppc64le
docker push bla/coredns:coredns-s390x
echo manifest-tool push from-args --platforms linux/amd64,linux/arm,linux/arm64,linux/ppc64le,linux/s390x --template bla/coredns:coredns-ARCH --target bla/coredns:1.0.1
manifest-tool push from-args --platforms linux/amd64,linux/arm,linux/arm64,linux/ppc64le,linux/s390x --template bla/coredns:coredns-ARCH --target bla/coredns:1.0.1
echo manifest-tool push from-args --platforms linux/amd64,linux/arm,linux/arm64,linux/ppc64le,linux/s390x --template bla/coredns:coredns-ARCH --target bla/coredns:latest
manifest-tool push from-args --platforms linux/amd64,linux/arm,linux/arm64,linux/ppc64le,linux/s390x --template bla/coredns:coredns-ARCH --target bla/coredns:latest
2017-12-21 10:34:19 -05:00
Miek Gieben
a8ba24fff9 plugin/proxy: for duration metrics ()
The README.md was updated by not the actual metric.

Fixes 
2017-12-20 18:25:43 -05:00
Yong Tang
4dd40a292c
Update apache/thrift to 0.11.0 and remove pinning ()
The `apache/thrift` recently released a new version of `0.11.0`
several days ago. This release is compatible with other packages
and as such, there is no need to pinning the `apache/thrift`
to `master` anymore in Gopkg.toml.

This fix removes the pinning of `apache/thrift` in Gopkg.toml,
and updates all dependencies of coredns.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-12-18 11:50:56 -06:00
Yong Tang
ba4e77672c Fix a couple of typos ()
`hanlder` -> `handler`

`bounderies` -> `boundaries`

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-12-15 21:31:57 +00:00
Yong Tang
c6937b0bfc Expose directives in dnsserver to help external plugin developers ()
This fix expose directives in dnsserver package, so that external
plugin developers could easily build customerized coredns+plugin
without changing the code base tree of coredns.

The following is an example that could bundle coredns+example,
in one simple file without modifying coredns codebase:

```
package main

import (
        _ "github.com/coredns/example"

        "github.com/coredns/coredns/coremain"
        "github.com/coredns/coredns/core/dnsserver"
)

var directives = []string{
        "example",
        "log",
        "errors",
        ...
        ...
        ...
        "whoami",
        "startup",
        "shutdown",
}

func init() {
        dnsserver.Directives = directives
}

func main() {
        coremain.Run()
}
```

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-12-15 07:26:36 +00:00
Brad Beam
cee6f60ab8 Adding additional records for test cases () 2017-12-14 14:14:10 -05:00