Commit graph

1009 commits

Author SHA1 Message Date
Ondřej Benkovský
70b51a73d3
add configurable log level to errors plugin (#4718)
Automatically submitted.
2021-07-09 14:23:02 +00:00
Ondřej Benkovský
a6a7e73813
do not log NOERROR in log plugin when response is not available (#4725)
Signed-off-by: Ondrej Benkovsky <ondrej.benkovsky@wandera.com>
2021-07-09 13:15:34 +02:00
Chris O'Haver
002b748ccd
plugin/cache: Unset AD flag when DO is not set for cache miss (#4736)
* unset AD bit when client DO is 0

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* add flag check to existing tests

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-07-09 10:53:50 +02:00
coredns[bot]
c610bfd87f auto go fmt
Signed-off-by: coredns[bot] <bot@bot.coredns.io>
2021-07-05 10:34:54 +00:00
Chris O'Haver
97bb9d87e5
fix to docs; add acl example (#4711)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-06-30 10:09:23 +08:00
Ondřej Benkovský
9e90d6231e
trace plugin can mark traces with error tag (#4720)
Signed-off-by: Ondrej Benkovsky <ondrej.benkovsky@wandera.com>
2021-06-29 09:10:22 +02:00
mfleader
38e409b4b6
Correct newdnsController's documented function signature (#4717)
Signed-off-by: mleader <mleader@redhat.com>
2021-06-24 15:18:08 -04:00
Chris O'Haver
a1aafbf405
Add NS+hosts records to xfr response. Add coredns service to test data. (#4696)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-06-14 16:39:40 +02:00
Miek Gieben
be8958552e
plugin/secondary: doc updates (#4686)
Add retry behavior on startup and point to RFC 5936

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-06-11 10:54:49 -07:00
Chris O'Haver
09b63df9c1
fix cidr multi-zone check (#4682)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-06-10 10:50:20 +02:00
Chris O'Haver
79d6795333
plugin/secondary: Retry initial transfer until successful (#4663)
* retry initial transfer

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* fix import grouping

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* add test; use backoff timeout

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* fix import order

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* manual backoff

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-06-10 10:49:31 +02:00
Miek Gieben
491e30a292
plugin/log: fix closing of codeblock (#4680)
This fixes the rendering of this README as html. The codeblock was
closed with 4 ~, should be 3.

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-06-08 07:33:15 -07:00
Licht Takeuchi
b9b27bbbd0
Fix Route53 plugin cannot retrieve ECS Task Role (#4669)
Signed-off-by: Licht Takeuchi <licht-t@outlook.jp>
2021-06-07 16:58:56 +02:00
coredns[bot]
cd1134f0c9 auto go fmt
Signed-off-by: coredns[bot] <bot@bot.coredns.io>
2021-06-07 10:43:28 +00:00
Sven Nebel
47be274d34
Fix plugin file reload comment (#4665)
Signed-off-by: Sven Nebel <nebel.sven@gmail.com>
2021-06-05 15:06:25 +02:00
Chris O'Haver
846ace3f51
Fix IPv6 case for CIDR format reverse zones (#4652)
* fix ipv6 case for cidr.Class

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* add check and test case for invalid ipv6 cidr

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* net package is bad at detecting ipv6/ipv4

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* rename Class -> Split

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-06-04 10:17:17 +02:00
Ben Kochie
9edfaed631
Reduce the cardinality of health endpoint metrics (#4650)
The health endpoint histogram has a large amount of cardinality for a
simple endpoint. Introduce a new "Slim" set of buckets for `/health` to
reduce the metrics load on large deployments. Especially those that have
per-node DNS caching services.

Add a metric to count internal health check failures rather than use the
timeout value as side effect monitor of the check error. This avoids
incorrectly recording the timeout value if there is an error that is not
a timeout (ex. refused)

Signed-off-by: SuperQ <superq@gmail.com>
2021-05-27 15:16:38 +02:00
uesyn
4c0fdc3909
plugin/kubernetes: consistently choose EndpointSlices or Endpoints for unstable API (#4647)
* confirm endpointslices is served or not

Signed-off-by: uesyn <suemura@zlab.co.jp>

* Apply suggestions

Signed-off-by: uesyn <suemura@zlab.co.jp>
2021-05-27 08:48:52 -04:00
Chris O'Haver
d8a0d97df2
deprecate Normalize and MustNormalize (#4648)
* deprecate normalize and mustnormalize

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* add runtime warning

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* elaborate runtime warning

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* include caller info

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-05-27 13:26:14 +02:00
Miek Gieben
163ac033ae
Revert "plugin/file: Fix in wrong answers returned when wildcard and concrete records exist (#4599)" (#4633)
reverting as I don't want to release 1.8.4 with this enabled.

This reverts commit fbf3f07f46.
2021-05-20 16:25:18 -04:00
Chris O'Haver
0348b019be
plugin/forward: Document and warn for unsupported FROM CIDR notations (#4639)
* trap unsupported FROM cidr notations

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* make is a warning

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-05-20 09:24:36 +02:00
Miek Gieben
5d80a6e21e
Fix obsure crash in Corefile parsing (#4637)
This was found by fuzzing.

We need to make this a fully qualified domain name to catch all errors
in dnsserver/register.go and not later when plugin.Normalize() is called again on these
strings, with the prime difference being that the domain name is fully
qualified. This was found by fuzzing where "ȶ" is deemed OK, but "ȶ." is
not (might be a bug in miekg/dns actually). But here we were checking ȶ,
which is OK, and later we barf in ȶ. leading to "index out of range".

Added a tests and check manually if it would crash with the current code
(yes), and fail with an error in this PR (yes).

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-05-19 10:38:37 -07:00
Jason Du
fbf3f07f46
plugin/file: Fix in wrong answers returned when wildcard and concrete records exist (#4599)
* plugin/file: Fix in wrong answers returned when wildcard and concrete records exist

Signed-off-by: Jason Du <xdu@infoblox.com>

* Remove superfluous change

Signed-off-by: Jason Du <xdu@infoblox.com>

* Re-implementation and new test case
If the domain's terminal is neither the matching wildcard, nor a domian directly
under the wildcard, return NXDOMAIN

Signed-off-by: Jason Du <xdu@infoblox.com>

* Fix empty non-terminal & add test case

Signed-off-by: Jason Du <xdu@infoblox.com>

* Cleanup

Signed-off-by: Jason Du <xdu@infoblox.com>

* Fix case on domain name with character before * and add more test cases

Signed-off-by: Jason Du <xdu@infoblox.com>

* Use different IPs for records in cornerCasesWildcard zone file

Signed-off-by: Jason Du <xdu@infoblox.com>
2021-05-17 13:21:08 -07:00
Miek Gieben
5f41d8eb1f
reverse zone: fix Normalize (#4621)
Make normalize return multiple "hosts" (= reverse zones) when a
non-octet boundary cidr is given.

Added pkg/cidr package that holds the cidr calculation routines; felt
they didn't really fit dnsutil.

This change means the IPNet return parameter isn't needed, the hosts are
all correct. The tests that tests this is also removed: TestSplitHostPortReverse
The fallout was that zoneAddr _also_ doesn't need the IPNet member, that
in turn make it visible that zoneAddr in address.go duplicated a bunch
of stuff from register.go; removed/refactored that too.

Created a plugin.OriginsFromArgsOrServerBlock to help plugins do the
right things, by consuming ZONE arguments; this now expands reverse
zones correctly. This is mostly mechanical.

Remove the reverse test in plugin/kubernetes which is a copy-paste from
a core test (which has since been fixed).

Remove MustNormalize as it has no plugin users.

This change is not backwards compatible to plugins that have a ZONE
argument that they parse in the setup util.

All in-tree plugins have been updated.

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-05-17 13:19:54 -07:00
Chris O'Haver
5409379648
consider nil ready as ready (#4632)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-05-17 16:10:30 -04:00
Jason Du
d1f520a5b2
Fix etcd to use v3.5.0-alpha.0 (#4628)
Signed-off-by: Jason Du <xdu@infoblox.com>
2021-05-14 23:55:01 -07:00
Keith Coleman
184d5e5214
check for two days of remaining validity (#4606)
Signed-off-by: Keith C <keith@fraudmarc.com>
2021-05-14 10:49:16 +02:00
Chris O'Haver
0a3375e76b
copy unready exclusion to v1beta1 func (#4616)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-05-10 13:29:56 -04:00
Chris O'Haver
24547447d0
plugin/kubernetes: Support both v1 and v1beta1 EndpointSlices (#4570)
* support v1 and v1beta1 endpointslice

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* update comments

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-05-10 09:57:23 -07:00
Keith Coleman
611500b7d4
plugin/dnssec: interface type correction for periodicClean sig validity check (#4608)
Signed-off-by: Keith C <keith@fraudmarc.com>
2021-05-06 10:33:16 +02:00
Chris O'Haver
d6d8a9974b
plugin/kubernetes: fix SOA response for non-apex queries (#4592)
* fix SOA response for non-apex queries

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* handle mixed case

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* do full string compare

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-05-04 11:05:08 +02:00
Chris O'Haver
e1931d48d1
collect endpoint node name from endopintslices (#4581)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-05-04 10:55:49 +02:00
wangchenglong01
b881a1ef13
Add error check to avoid panic (#4584)
* Add error check to avoid panic

Signed-off-by: Cookie Wang <luckymrwang@163.com>

* Add error check to avoid panic

Signed-off-by: Cookie Wang <luckymrwang@163.com>

Co-authored-by: Cookie Wang <luckymrwang@163.com>
2021-05-04 10:08:06 +02:00
Uwe Krueger
40edf1e566
plugin/rewrite: streamline the ResponseRule handling. (#4473)
* plugin/rewrite: streamline the ResponseRule handling.

The functionality of a response rule is now completely encapsulated behind
a `ResponseRule` interface. This significantly simplifies the complete
processing flow, it enables more flexible response handling and it is possible
to eliminate lots of state flags, ifs and switches.

Based on the new flexibility the pull request also enables to support a
response name rewrite for all name rewrite types.
To be compatible, an explicit `answer auto` option is added to support
a best effort response rewrite (name and value).
Additionally now all name rewrite rules support additional name and value
reponse rewrite options.

Using this feature it is also possible now to rewrite a complete sub domain
hierarchy to a single domain name combined with a correct rewrite (#2389).

Signed-off-by: Uwe Krueger <uwe.krueger@sap.com>

* revert policy

Signed-off-by: Uwe Krueger <uwe.krueger@sap.com>

Co-authored-by: Miek Gieben <miek@miek.nl>
2021-05-04 10:05:45 +02:00
ntoofu
696c8731d6
plugin/etcd: Fix inconsistent names of glue records with TargetStrip (#4595)
* etcd plugin: Add testcases for `TargetStrip` feature

Signed-off-by: ntoofu <ntoofu@users.noreply.github.com>

* etcd plugin: Fix inconsistent names in glue records

Signed-off-by: ntoofu <ntoofu@users.noreply.github.com>
2021-05-03 08:48:51 -07:00
Chris O'Haver
ef53f372ee
exclude unready endpoints from endpointslices (#4580)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-04-27 12:29:32 -04:00
Miek Gieben
13cef2ee09
plugin/dnssec: use entire RRset as key input (#4537)
* plugin/dnssec: use entire RRset as key input

This uses the entire rrset as input for the hash key; this is to detect
differences in the RRset and generate the correct signature.

As this would then lead to unbounded growth, we periodically (every 8h)
prune the cache of old entries. In theory we could rely on the random
eviction, but it seems nicer to do this in a maintannce loop so that we
remove the unused ones. This required adding a Walk function to the
plugin/pkg/cache.

Signed-off-by: Miek Gieben <miek@miek.nl>

* Update plugin/dnssec/cache.go

Co-authored-by: Chris O'Haver <cohaver@infoblox.com>

Co-authored-by: Chris O'Haver <cohaver@infoblox.com>
2021-04-05 06:45:28 -07:00
cuirunxing-hub
454bc9e0b9
typos correct (#4560)
Signed-off-by: cuirunxing-hub <cuirunxing@inspur.com>
2021-04-05 09:34:25 -04:00
Chris O'Haver
9f72db12e7
plugin/kubernetes: do endpoint/slice check in retry loop (#4492)
* do endpoint/slice check in retry loop

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-03-26 08:54:39 -04:00
Mohammad Yosefpor
ea41dd23a0
plugin/bind: exclude interface or ip address (#4543)
* plugin/bind: exclude interface or ip address

Signed-off-by: Mohammad Yosefpor <myusefpur@gmail.com>

* fix README.md

Signed-off-by: Mohammad Yosefpor <myusefpur@gmail.com>

* Apply suggestions, Fix test

Signed-off-by: Mohammad Yosefpor <myusefpur@gmail.com>

* Apply suggestions, move errs to setup

Signed-off-by: Mohammad Yosefpor <myusefpur@gmail.com>
2021-03-25 16:38:17 +01:00
Frank Riley
5b9b079dab
Add cache eviction metrics to the cache plugin (#4411)
Signed-off-by: Frank Riley <fhriley@gmail.com>
2021-03-21 16:58:16 +01:00
Miek Gieben
ed3f287fe8
metrics: remove RR type (#4534)
To combat label cardinality explosions remove the type from metrics.
This was most severe in the histogram for request duration, remove it
there.

It's also highlighted difference between grpc and forward code, where
forward did use type and grpc didn't; getting rid of all that "fixes"
that discrepancy

Move monitor.go back into the vars directory and make it private again.
Also name it slightly better

Fixes: #4507

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-03-19 12:59:26 +01:00
Miek Gieben
634e3fe8f5
plugin/health: add logging for local health request (#4533) 2021-03-19 03:40:38 -07:00
Miek Gieben
8faca26873
plugin/bind: tweak error messages (#4532)
When the interface doesn't exist you get:

plugin/bind: not a valid IP address: eth0

Fix the wording that this can also be interface name. Also %q the
argument in the error mesg.

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-03-18 15:39:40 +01:00
Mohammad Yosefpor
deb09c8905
plugin/bind: Discard link-local addresses on binding by interface name (#4531)
* Discard link-local addresses on binding

Signed-off-by: Mohammad Yosefpor <myusefpur@gmail.com>

* Update plugin/bind: README.md

Signed-off-by: Mohammad Yosefpor <myusefpur@gmail.com>

* Except for IPv6 link-local only

Signed-off-by: Mohammad Yosefpor <myusefpur@gmail.com>
2021-03-18 10:54:57 +01:00
Mohammad Yosefpor
61b5cdb352
plugin/bind: Bind by interface name (#4522)
* auto make -f Makefile.doc

Signed-off-by: Mohammad Yosefpor <myusefpur@gmail.com>

* Bind by interface name

Signed-off-by: Mohammad Yosefpor <myusefpur@gmail.com>

* README.md: Interface with multiple address

Signed-off-by: Mohammad Yosefpor <myusefpur@gmail.com>

* auto make -f Makefile.doc

Signed-off-by: Mohammad Yosefpor <myusefpur@gmail.com>

* auto make -f Makefile.doc

Signed-off-by: Mohammad Yosefpor <myusefpur@gmail.com>

* Elaborate more on the behaviour in README.md, revert man/*, fix tests

Signed-off-by: Mohammad Yosefpor <myusefpur@gmail.com>

* auto make -f Makefile.doc

Signed-off-by: Mohammad Yosefpor <myusefpur@gmail.com>

* --sign-off

Revert man/* to fix DCO check

Signed-off-by: Mohammad Yosefpor <myusefpur@gmail.com>

* auto make -f Makefile.doc

* Revert man/* to fix DCO check

Signed-off-by: Mohammad Yosefpor <myusefpur@gmail.com>

Co-authored-by: coredns-auto-go-mod-tidy[bot] <coredns-auto-go-mod-tidy[bot]@users.noreply.github.com>
2021-03-18 07:38:48 +01:00
Chris O'Haver
929aa3886e
add metadata section to docs (#4525)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-03-16 13:51:21 +01:00
Chris O'Haver
32cc745dc2
add forward/upstream metadata (#4521)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-03-16 13:34:22 +01:00
Miek Gieben
a9aedb79cf
plugin/minimal: fix import path (#4523)
presubmit failing, fix import path.

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-03-16 10:55:21 +01:00
Miek Gieben
064d6cdd0a
Revert "plugin/sign: track zone file's mtime (#4431)" (#4511)
This reverts commit c4720b8ad2.
2021-03-15 15:42:13 +01:00