Commit graph

1271 commits

Author SHA1 Message Date
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
fd7abd9849
Add OWNERS file (#1486)
This should have everyone, but the process was quite manual. The rename
from middleware -> plugin also meant I had to do some extra digging on
who actually submitted the PR. I also double checked the current list of
people with commit access.

Every plugin now has an OWNERS, except *reverse*. I'll file a bug for
that.
2018-02-08 10:55:51 +00:00
Sandeep Rajan
a4e0f6452d plugin/rewrite: remove do set in edns0 (#1500)
* remove setdo

* gofmt
2018-02-07 13:53:23 -05:00
Chris O'Haver
82854bf098 plugin/kubernetes: Allow only one k8s section (#1497)
* allow only one k8s section

* add test
2018-02-07 16:31:08 +00:00
Paul Greenberg
f636930c5c plugin/rewrite: rewrite responses for all record types (#1460) (#1463) 2018-02-06 18:40:46 +00:00
Harshavardhana
367ed65f22 Fix default endpoint port (#1490) 2018-02-06 07:07:43 +00:00
Miek Gieben
5b844b5017
plugin/forward: add it (#1447)
* plugin/forward: add it

This moves coredns/forward into CoreDNS. Fixes as a few bugs, adds a
policy option and more tests to the plugin.

Update the documentation, test IPv6 address and add persistent tests.

* Always use random policy when spraying

* include scrub fix here as well

* use correct var name

* Code review

* go vet

* Move logging to metrcs

* Small readme updates

* Fix readme
2018-02-05 22:00:47 +00:00
Miek Gieben
fb1cafe5fa
pkg/up: add generic run-this-functions (#1481)
This adds a generic way of start a check function to check a backend.
This package can be used to kick off healthchecks. The package makes
sure only 1 is run at any one time.

It should allow for:
See upstream error -> kick off healthcheck

and not to worry about overwhelming the upstream with a barrage of
queries.
2018-02-05 22:00:29 +00:00
Francois Tur
2440024772 Plugin/RELOAD - Tune usage of var global, add limit to options (#1457)
* tune usage of var global, add limit to options

* update readme for minimal values

* useless change to quick-off codecov

* fix msgs for min values and tune the flag for end of reload usage, with a 'maybe' option

* adding UT for min values, adding MD5 of corefile on the log
2018-02-02 13:15:56 -05:00
Uladzimir Trehubenka
3fb07161b7 Fixed dnstap panic after graceful restart (send on closed channel) (#1479) 2018-02-02 11:59:22 +02:00
Francois Tur
b93a36b213 Plugin/Proxy - add new policy always_first to mimic windows dns resolvers (#1459)
* add new policy always_first to mimic windows dns resolvers
fill documentation, add UT and cleanup fmt

* change name of policy from always_first to first. Update docs
2018-01-30 16:29:49 -05:00
Tobias Schmidt
0af9b9b16f plugin/proxy: Fix unnecessary message truncation (#1477)
As plugin/proxy always returns compressed messages, it's important to
set this before calling Scrub(), as some messages will be unnecessarily
truncated otherwise.
2018-01-30 23:18:44 +02:00
Tobias Schmidt
64d7268ed6 plugin/proxy: Don't enable HTTP healthchecking if not configured (#1441)
HTTP healthchecking will be implicitely activated for proxy upstream
hosts, even if not configured. The README states that not using the
health_check directive will disable HTTP healthchecks though.

It seems to me that the availability of the HealthCheck.Path attribute
is used as indicator whether HTTP healthchecks should be used or not.
The normalizeCheckURL() function didn't check that attribute though,
always returning a CheckURL. This would increase the healthcheck failure
on every third failure in plugin/proxy, without any possibility for the
upstream host to be marked as healthy again. This would eventually
remove all upstream hosts from the serving pool.
2018-01-30 23:10:07 +02:00
Yong Tang
2b268134e9
Golint fix (#1475)
Golint fix to make goreportcard happy

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-30 09:31:39 -08:00
Miek Gieben
f91cb61086 Don't use standard lib context package (#1468)
With Go 1.9 you *can* include the std lib's context package and nothing
breaks. However we never officially made the move (and grpc also doesn't
ues the std lib's one).

Standardize all plugins on using the extern context package.

Fixes #1466
2018-01-30 09:19:37 -05:00
Chris O'Haver
449bb1ac6c
spelling (#1461) 2018-01-29 13:16:13 -05:00
Miek Gieben
399073ec6b pl/kubernetes: drop the comma parsing (#1453)
Let caddyfile parser give us the token, the comma sep thing also didn't
work.

Fixes #1446
2018-01-28 08:40:10 -08:00
John Belamaric
d27be86e3e
Minor refactor of proxy parsing to make upstreams re-usable in other plugins (#1426) 2018-01-27 17:25:39 -05:00
John Belamaric
0b35d4d28f Reload hook (#1445)
* Add reload directive

* gofmt

* Fix default jitter and error message

* remove unneeded call to NextArg, add a couple negative setup tests

* Review feedback
2018-01-27 10:42:57 +00:00
Pat Moroney
4b5fc3002e correct typo from hosts to route53 (#1437) 2018-01-25 23:17:47 +00:00
Ilya Galimyanov
1e75061aec Remove pointers to labels.Selector and pass normally instead (#1422) 2018-01-24 20:44:18 +00:00
Tobias Schmidt
a0ad2ff0af plugin/etcd: Remove unnecessary test cases (#1421)
These test cases became invalid with the fix of message truncation and
don't validate anything.
2018-01-24 14:09:57 +00:00
Tobias Schmidt
697e2b4bda Fix truncation of messages longer than permitted by the client (#1417)
* Fix truncation of messages longer than permitted by the client

CoreDNS currently doesn't respect the maximum response size advertised
by the client and returns the full answer on a message with the TC bit
set. This breaks client implementations which rely on DNS servers
respecting the advertised size limit, for example the Ruby stdlib
client. It also has negative network performance implications, as large
messages will be split up into multiple UDP packets, even though the
client will discard the truncated response anyway.

While RFC 2181 permits the response of partial RRSets, finding the
correct number of records fitting into the advertised response size is
non-trivial. As clients should ignore truncated messages, this change
simply removes the full RRSet on truncated messages.

* Remove incorrect etcd test assertion

If a client requests a TXT record larger than its advertised buffer
size, a DNS server should _not_ respond with the answer, but truncate
the message and set the TC bit, so that the client can retry using TCP.
2018-01-24 13:28:26 +00:00
Tobias Schmidt
b707438534 Add coredns_build_info metric (#1418)
In order to track the rollout status of CoreDNS versions, add the common
build_info metric.
2018-01-23 20:10:55 +00:00
Francois Tur
f9c03c2ead fix computation of reverse zone based on Ipv6 CIDRs (#1415) 2018-01-23 15:58:36 +00:00
Miek Gieben
9575789c36
plugin/secondary: don't duplicate apex records (#1413)
See #1400 and the discussion in that bug.

Fixes #1400
2018-01-23 10:35:31 +00:00
Miek Gieben
85457cf50d
plugin/secondary: fix a bunch of things and tests (#1406)
Fix the error handling. Log when we have an error during any of the
transfer state. And if there isn't an error transfer the zones.

Also fix the tests in test/ so we, at least, check the initial transfer.

Update the docs to show more about how errors are handled.

Ref #1400
2018-01-23 10:35:10 +00:00
Paul Greenberg
7d371edb2d plugin/rewrite: add response rewrite docs (#1414) 2018-01-22 22:01:13 -05:00
Paul Greenberg
258c163bb0 feature: plugin/rewrite: rewrite ANSWER SECTION (#1318)
Resolves: #1313
2018-01-18 10:41:14 -05:00
Miek Gieben
cb3190bab1
plugin/dnssec: fix blacklies for NXDOMAIN (#1399)
* plugin/dnssec: filter bitmap also for NXDOMAIN responses

We change nxdomain to nodata, so at the point when we receive the
reply it can be nxdomain or nodata. In both cases we should filter the
nsec bitmap.

Change the code and add explicit tests for this.

* More tests
2018-01-18 13:07:23 +00:00
Miek Gieben
c39e5cd014
plugin/health: add lameduck mode (#1379)
* plugin/health: add lameduck mode

Add a way to configure lameduck more, i.e. set health to false, stop
polling plugins. Then wait for a duration before shutting down. As the
health middleware is configured early on in the plugin list, it will
hold up all other shutdown, meaning we still answer queries.

* Add New

* More tests

* golint

* remove confusing text
2018-01-18 10:40:09 +00:00
Miek Gieben
318bab7795
plugin/dnssec: check validityperiod of RRSIGs (#1385)
* plugin/dnssec: check validityperiod of RRSIGs

Somehow we missed implementing this. If a sig a retrieved from the
cache, but not valid anymore, regenerate it instead of server invalid
signatures.

Fixes #1378

* drop from cache after 3/4 validity

* six days means 6 days
2018-01-18 10:39:22 +00:00
Tobias Schmidt
dd9fc8962c plugin/cache: Fix prefetching issues (#1363)
* Improve plugin/cache metrics

* Add coredns_cache_prefetch_total metric to track number of prefetches.
* Remove unnecessary Cache.get() call which would incorrectly increment
  cache counters.
* Initialize all counters and gauges at zero.

* Allow prefetching of a single request per ttl

The original implementation didn't allow prefetching queries which are
only requested once during the duration of a TTL. The minimum amount of
queries which had to be seen was therefore capped at 2.

This change also implements a real prefetch test. The existing test was
a noop and always passed regardless of any prefetch implementation.

* Fix prefetching for items with a short TTL

The default prefetch threshold (percentage) is 10% of the lifetime of a
cache item. With the previous implementation, this disabled prefetching
for all items with a TTL < 10s (the resulting percentage would be 0, at
which point a cached item is already discarded).

This change uses a time based threshold calculation and ensures that
a prefetch is triggered at a TTL of 1 at the latest.

* Fix wrong duration reporting of cached responses

The logging and metrics plugins (among others) included the duration of
a cache prefetch in the request latency of client request. This change
fixes this wrong reporting and executes the prefetch request in a
goroutine in the background.
2018-01-17 07:35:22 +00:00
Yong Tang
fe0767987e
Fix several typos (#1395)
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-15 18:27:47 -08:00
Yong Tang
584dd87c70
Add route53 plugin (#1390)
* 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 (#1391)
SOA records are returned in the authority section, not as answer.
2018-01-15 13:55:10 +00:00
Miek Gieben
05ebfaa36a
plugin/log: add the super useful msg ID into the logs (#1387) 2018-01-12 18:03:47 +00:00
cricketliu
a952c07453 Update README.md (#1381)
Minor textual cleanup.
2018-01-11 18:19:16 +00:00
Tobias Schmidt
f1b280de53 Remove TTL ceiling at 5s in plugin/cache (#1380)
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
cricketliu
5ac8ab4b45 Update README.md (#1376)
Minor textual cleanup.
2018-01-11 07:32:06 +00:00
cricketliu
3e298d2396 Update README.md (#1375)
More minor textual fixes.
2018-01-11 07:31:52 +00:00
cricketliu
655231a599 Update README.md (#1374)
Fixing a couple of small textual problems.
2018-01-11 07:31:34 +00:00