Commit graph

302 commits

Author SHA1 Message Date
Miek Gieben
ada704e0ae middleware/httpproxy: disable v6 lookup
Don't lookup the AAAA dns.google.com.
2016-11-30 20:44:45 +00:00
Miek Gieben
b85c6788dd Merge branch 'master' of github.com:miekg/coredns 2016-11-29 21:58:13 +00:00
Miek Gieben
8c8b37a30e middleware/metrics: export actual size (#448)
The `*_size*` metrics now export the actual packet length, not the
advertised one (although that might be nice as well).
2016-11-29 11:02:43 +00:00
Miek Gieben
4cfd19c7c9 middleware/httpproxy: add debug queries (#446)
* middleware/httproxy: implement debug queries

Not too useful at the moment, but o-o.debug queries are supported
and return the Comment from dns.google.com.

Note that this is not always set.

* improve documentation

* Testing cleanups
2016-11-29 09:54:57 +00:00
Miek Gieben
0876a38cd9 middleware/httproxy: smaller timeouts
Make the timeouts smaller after we fail to connect.
2016-11-27 15:24:50 +00:00
Miek Gieben
96222927a3 middleware/httpproxy: Add (#439)
This PR adds a middleware that talks to dns.google.com over HTTPS,
meaning all your DNS traffic is encrypted when traversing your ISP and
the internet.

The `dns.google.com` address is re-resolved every 30 seconds.
2016-11-26 17:57:22 +00:00
Miek Gieben
f8b9332265 Use upstream parsing from master branch (#438) 2016-11-24 22:31:42 +01:00
Miek Gieben
a951fee291 merge conflict fixed 2016-11-24 21:51:38 +01:00
Miek Gieben
4a8db8a4ce middleware/proxy: config syntax cleanups (#435)
* middleware/proxy: config syntax cleanups

Allow port numbers to be used in the transfer statements and clean
up the proxy stanza parsing. Also allow, when specifying an upstream,
/etc/resolv.conf (or any other file) to be used for getting the upstream
nameserver.

Add tests and fix the documentation to make clear what is allowed.

* Fix the other upstream parse as well
2016-11-24 16:57:20 +01:00
Miek Gieben
ec2138b21c middleware/file: better notify error reporting
Report errors as originating from notifies in all cases.

Fixes #412
2016-11-24 15:04:27 +00:00
Mark Nevill
1cf5e56d5a Propagate both message and error in proxy exchange. 2016-11-23 19:09:35 +00:00
Miek Gieben
25c57ea314 Merge pull request #428 from johnbelamaric/k8s-fix-ptr
K8s Test Cleanup and Service PTR
2016-11-16 10:20:34 +00:00
Miek Gieben
b827c691bb middleware/auto: Close to reader
Close the reader, stop leaking file descriptors.
2016-11-16 10:16:56 +00:00
John Belamaric
afe4368c34 K8s Test Cleanup and Service PTR
Change the CI setup for K8s to be simpler. Now it just creates a
set of objects via a yaml file, making it very easy to modify
the tests.

Implement PTR for services.
2016-11-15 01:35:24 +00:00
Michael Grosser
ecbb6baccd Add docs
Provide TTL examples for cache middleware. Fixes: #364

Add interaction docs to make non invalidation for cache middleware
clear. Cache might serve stale records. Fixes: #403
2016-11-14 16:06:41 +00:00
Yong Tang
137fc33b8f Fix several typos in docs. (#426)
Fixes several typos in docs.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-11-14 07:25:17 +00:00
Michael Grosser
ece3cf8ecf Fix various issues with formatting and typos (#424)
* Fix typos

* Simplify code

* Fix error usage
2016-11-13 14:03:12 +00:00
Miek Gieben
651f3938a1 More idiomatic Go 2016-11-11 16:56:15 +00:00
Chris O'Haver
96206cdbc3 Return NXDOMAIN when no items match query (#422)
* When no records match, reply with NXDOMAIN

* Implement in IsNameError

* case for unexposed namespace. k8s integation tests

* Fix imports order. Lower case of err strs.
2016-11-10 21:24:06 +00:00
Miek Gieben
8dd47dd932 Remove some printlns 2016-11-10 14:09:49 +00:00
Miek Gieben
9328a8e7a4 Compile fixes and make it work 2016-11-10 12:58:40 +00:00
Miek Gieben
d383f279a0 Implement external lookups for CNAMEs 2016-11-10 07:48:47 +00:00
Miek Gieben
0919216d3c middleware/{file, auto}: resolve external CNAMEs
Do the same thing as in etcd and give the option of externally resolving
CNAME. This is needed when CoreDNS is a proxy as well is serving zones.
2016-11-09 21:26:49 +00:00
Chris O'Haver
48e1909218 Add type to default template 2016-11-09 21:07:27 +00:00
Michael Grosser
a8287bb04d middleware/log cleanup readme (#413) 2016-11-09 13:02:06 +00:00
Miek Gieben
e210b06e89 middleware/file: also react to rename events. (#406)
* middleware/file: also react to rename events.

* React to all events
2016-11-09 10:02:52 +00:00
Miek Gieben
4ef53081c5 middleware/file: Add CNAME chain support (#400)
Up till now we would only chase 1 CNAME. Spec requires we will chase
all. This PR add support for this.  Up to 8 CNAMEs are chased (this
could be longer, by just checking for cycles, but 8 seems enough for
now).

Also add RRSIG of the first CNAME for DNSSEC.
2016-11-09 10:02:26 +00:00
Miek Gieben
6abbe231e5 middleware/cache: cache 0 will be capped at 5 (#408)
* middleware/cache: cache 0 will be capped at 5

cache 0 would return TTL=0 records, up that to the documented minimum of
5 seconds.

* middleware/cache: check for 0 TTL

Handle 0 TTL differently and return an error, we might need to
special case this in the future.
2016-11-09 10:01:26 +00:00
Miek Gieben
0f8cb5094d middleware/file: notify better error reporting
Slightly better errors reporting for failing to sent a notify.
2016-11-08 21:45:27 +00:00
Miek Gieben
fb7fcff982 middleware/file|auto: Notifies and AXFR (#399)
Be more explicit in the logs when a notify fails.
New notify error message looks like:

2016/11/07 18:21:42 [ERROR] Notify for zone "example.org." was not accepted by "8.8.8.8:53": rcode was "SERVFAIL"

Correctly pick up secondaries

When multiple secondary are specified make sure they are picked up.

Fixes #393 #398
2016-11-07 19:15:21 +00:00
Miek Gieben
e89c4b5c28 middleware/cache: only cache query and responses (#397)
Extent typify to check the transfers, dynamic updates and notifies.
Extend *cache* to not put these in the cache.

Fixes #393
2016-11-07 16:27:50 +00:00
John Belamaric
4318dfbf02 Fix Kubernetes Watches (#392)
The watchers were still trying to process raw v1 objects which
failed to be added to the store. This meant new services and
namespaces created after CoreDNS started would not be discoverable.

Add a filter function that converts watch events with v1 objects
to events with api objects.
2016-11-07 16:21:24 +00:00
Miek Gieben
3d5be649a2 Issue 388 (#389)
* add extra test

* middleware/auto: fix crash when calling empty handler

Don't call the next middleware, we should be auth. for this zone
getitng into this path we should respond with ServFail.

Fixes #388
2016-11-07 11:12:20 +00:00
Miek Gieben
0f22d32191 Fix compilation error 2016-11-07 10:33:48 +00:00
Miek Gieben
d03c0b9932 finish missing watcher check (#387) 2016-11-07 08:00:30 +00:00
Miek Gieben
fc85754849 Golint (#386)
Lint and vet the curret code add docs about adding a git post-commit
hook that performs these actions after each commit.
2016-11-07 07:43:38 +00:00
Miek Gieben
d3dae8d77f middleware/auto: handle non-existent directory (#385)
Don't panic on a non-existent directory. Add test for it as well.

Fixes #384
2016-11-06 19:37:43 +00:00
Miek Gieben
243797a387 middleware/file: add nsec for wildcard expansion (#382)
A NSEC record is need to deny any other name that might exist.
Also don't blindly perform the interface conversion when getting
glue for NS records as they now may include RRSIG - also add tests
for that.
2016-11-06 08:32:07 +00:00
Miek Gieben
8d3418c015 BackendService: add Reverse method (#381)
Add a Reverse method to BackendService because different backends want
to to do diff. things. This allows etc/k8s to share even more code and
we can unify the PTR handling.
2016-11-05 15:43:27 +00:00
Miek Gieben
2cca527d9f middleware/file: fix delegations (#376)
Fix the delegation handling in the *file* and *dnssec* middleware.
Refactor tests a bit and show that they are failling.

Add a Tree printer, cleanups and tests.
Fix wildcard test - should get no answer from empty-non-terminal
2016-11-05 14:39:49 +00:00
John Belamaric
229c82c418 Fix k8s client (#379)
* Fix k8s client to use client-go

* Fix Kubernetes Build Issue

The client-go code requires you to vendor. I have done a hack here
in the Makefile to vendor it to version 1.5. But looks like we
will need to do this the 'right' way soon.

* Convert v1 to api Objects in List Functions

Also removed the endpoint controller which was not used for anything.
The Watch functions may still need the same treatment.

* Vendor client-go release-1.5

* Fix basic SRV feature

This is actually not serving SRV records correctly, but this should
get it to work as it did prior to the k8s client changes. Another
fix will be needed to serve SRV records as defined in the spec.

* Add additional output in test result

Add the response to the test output.

* Fix erroneous test data
2016-11-05 11:57:08 +00:00
Ben Kochie
775d26c5e2 Add metrics for cache hits/misses (#375)
* Add metrics for cache hits/misses

Add counters for cache middleware hits and misses.

* Add test for cache middleware hit/miss counters.

* Fix cache hit metric incrementing.

* Add cache hit/miss metrics to dnssec middleware.

* Update README metric documentation.
2016-10-31 18:50:50 +00:00
Miek Gieben
27d893cf33 ServiceBackend interface (#369)
* Add ServiceBackend interface

This adds a ServiceBackend interface that is shared between etcd/etcd3
(later) and kubernetes, leading to a massive reduction in code. When
returning the specific records from their backend.

Fixes #273
2016-10-30 15:54:16 +00:00
Manuel Alejandro de Brito Fontes
1b923adde6 Fix k8s build (#373) 2016-10-30 14:58:33 +00:00
Ben Kochie
98a8fb2622 Update metric names (#371)
Cleanup names/typos to match standard naming conventions.
2016-10-30 09:06:57 +00:00
Miek Gieben
cb867ff6bd middleware/metrics: export ListenAddr (#366)
ListenAddr is the address where the prometheus metric are exported.
This can be used in tests to listen on "localhost:0" and then later
retrieve the metrics from there. It makes the tests indepent on each
other.
2016-10-28 12:57:10 +01:00
Miek Gieben
0509f4b4ac middleware/file: reload on file mv (#365)
When a file is moved into position we should also reload the zones'
content.

This also fixes deadlock bug in the locking, a reload would block any
further lookups.
2016-10-28 12:57:02 +01:00
Miek Gieben
54964653d1 middleware/proxy: add request duration monitoring (#362)
Add a separate request duration metrics specially for proxying requests
upstream.

Fixes #259
2016-10-28 12:54:49 +01:00
Miek Gieben
ba26f47d5c middleware/caching (#360)
Add the rcode to the cached item and use this when we synthesize the
answer again. We could also infer the rcode from the reassembled
message, but this seems easier and is only an integer.

Also set the autoritative bit to 0 for all from-cache answers.

Fixes 357
2016-10-28 07:50:16 +01:00
Miek Gieben
039596f319 middleware/file: add test for reload (#361)
This add a highlevel integration test for zone reloading. It also
fixes a data race in the actual reloading process.
2016-10-27 21:01:04 +01:00