Commit graph

1271 commits

Author SHA1 Message Date
Ondřej Benkovský
e0110264cc
plugin/forward : add proxy address as tag (#4757)
Signed-off-by: Ondrej Benkovsky <ondrej.benkovsky@wandera.com>
2021-07-16 14:35:39 +02:00
Miek Gieben
50d888f3d7
plugin/header: run go gen and small doc updates (#4754)
* plugin/header: run go gen and small doc updates

Run go gen to enable the new plugin, this should fix the CI failures.
Small tweaks to the docs.

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

* another typo

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

* gofmt

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-07-15 10:10:16 +02:00
Qasim Sarfraz
00128bda4e
plugin/header: Introduce header plugin (#4752)
* Add header plugin

Signed-off-by: MQasimSarfraz <syed.qasim.sarfraz@gmail.com>

* fix import format

* improve README.md

* Add codeowners for header plugin
2021-07-15 09:32:39 +02:00
Jeongwook Park
faa10f61af
Fix typo on kubernetes plugin (#4753)
- modifed -> modified

Signed-off-by: jeongwook-park <jeongwook.park@navercorp.com>
2021-07-14 14:29:41 -04:00
Sven Nebel
21f1207afe
Create geoip plugin (#4688)
* Create geoip plugin

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Update plugin/geoip/README.md

Co-authored-by: Miek Gieben <miek@miek.nl>
Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Update plugin/geoip/README.md

Co-authored-by: Miek Gieben <miek@miek.nl>
Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Update plugin/geoip/README.md

Co-authored-by: Miek Gieben <miek@miek.nl>
Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Move DBFILE bullet below example

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Update plugin/geoip/README.md

Co-authored-by: Miek Gieben <miek@miek.nl>
Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Remove plugin name test case

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Remove languages option

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Update free database link

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Remove last language bits

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Use 127.0.0.1 as probing IP

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Update plugin/geoip/geoip.go

Co-authored-by: Miek Gieben <miek@miek.nl>
Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Update plugin/geoip/geoip.go

Co-authored-by: Miek Gieben <miek@miek.nl>
Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Use relative path for fixtures dir

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Set names with default string zero value

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Remove unused db types

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Remove non city databases in testdata

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Remove create databases main

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Fix metadata label format test case

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Fix import path block

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* go fmt after changes

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Tidy up go.mod and go.sum

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Add plugin to CODEOWNERS

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

Co-authored-by: Miek Gieben <miek@miek.nl>
2021-07-14 09:25:30 +02:00
Ondřej Benkovský
936b483a3a
publish trace id as metadata from trace plugin (#4749)
Signed-off-by: Ondrej Benkovsky <ondrej.benkovsky@wandera.com>
2021-07-14 09:21:41 +02:00
coredns[bot]
ae0431e4da auto go fmt
Signed-off-by: coredns[bot] <bot@bot.coredns.io>
2021-07-12 10:32:17 +00:00
Ondřej Benkovský
d17e50afc7
plugin/trace: fix rcode tag in case of no response (#4742)
Signed-off-by: Ondrej Benkovsky <ondrej.benkovsky@wandera.com>
2021-07-10 07:34:53 +02:00
Chris O'Haver
6efda5293e
fix example (#4740)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-07-09 13:00:43 -04:00
Chris O'Haver
a7d44b65e2
update example description to match example (#4739)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-07-09 09:42:37 -07:00
Miek Gieben
a26462c28c
plugin/error: use warning instead of warn (#4738)
We use the 'WARNING' in the logs, instead of warn, so make the change
here as well for consistency sake.

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-07-09 09:38:58 -07:00
Ondřej Benkovský
2a61309cad
when no response is written, fallback to status of next plugin in prometheus plugin (#4727)
* when no response is written, fallback to status of next plugin in prometheus plugin

Signed-off-by: Ondrej Benkovsky <ondrej.benkovsky@wandera.com>

* fixup! when no response is written, fallback to status of next plugin in prometheus plugin

Signed-off-by: Ondrej Benkovsky <ondrej.benkovsky@wandera.com>
2021-07-09 16:35:38 +02:00
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