1396 Commits

Author SHA1 Message Date
Chris O'Haver
f8a02aaf58 dont panic when from-zone cannot be normalized (#5170)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-02-17 15:13:18 -05:00
xuweiwei
86a5902209 plugin/file: add TXT RR test case (#5079)
Signed-off-by: xuweiwei <xuweiwei_yewu@cmss.chinamobile.com>
2022-02-17 13:58:18 -05:00
Rudolf Schönecker
c121aaab34 Add metric counting DNS-over-HTTPS responses (#5130)
Signed-off-by: Rudolf Schonecker <rudolf.schonecker@jamf.com>
2022-02-17 08:37:40 -05:00
Chris O'Haver
e5626a77bb plugin/secondary: Fix startup transfer failure wrong zone logged (#5085)
* avoid race

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-02-14 12:12:08 -05:00
Elijah Andrews
80195c399f add zones label to cache metrics (#5124)
* add zones to cache metrics

Signed-off-by: Elijah Andrews <elijahcandrews@gmail.com>
2022-02-14 12:10:30 -05:00
Yong Tang
c6709d930f Fix security scans by cleaning up file path (#5185)
While performing security scans there were several
issue raised as G304 (CWE-22): Potential file inclusion via variable.
As some files path are taken from user input, it is possible the
filepath passed by user may have unintended effect if not properly formed.
This fix add Clean to remove the security warning and address some
potential issue.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2022-02-14 11:24:21 -05:00
coredns[bot]
b40f2a0a44 auto go fmt
Signed-off-by: coredns[bot] <bot@bot.coredns.io>
2022-02-14 10:32:27 +00:00
Chris O'Haver
fe9ba42590 plugin/autopath: Don't panic on empty token (#5169)
* dont panic on empty token

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-02-10 09:00:27 -05:00
Chris O'Haver
c5eb7d0460 dont panic when from-zone cannot be normalized (#5171)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-02-10 08:59:34 -05:00
Chris O'Haver
d6743531ad fix healthy proxy error case (#5168)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-02-10 08:58:46 -05:00
Chris O'Haver
4693f40990 Revert "add wildcard warnings (#5030)" (#5167)
This reverts commit 744468ea78.
2022-02-09 11:25:15 -08:00
Chris O'Haver
4349b6fa63 dont panic on empty SRV segments (#5173)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-02-09 13:52:53 -05:00
Chris O'Haver
daace98352 plugin/metrics: Acknowledge other stats exported in README (#5172)
* mention default go stats and other plugin stats in README

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-02-09 13:52:18 -05:00
Tomas Hulata
b0edae07f1 Health-checks should respect force_tcp (#5109)
* health check should respect force_tcp

Signed-off-by: tombokombo <tombo@sysart.tech>
2022-02-09 09:45:52 -05:00
Chris O'Haver
abaf938623 remove wildcard query functionality (#5019)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-02-09 09:25:10 -05:00
Yong Tang
041e1eabc6 Fix a couple of code scanning alerts (#5157)
This PR fixed a couple of code scanning alerts:

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2022-02-07 09:09:12 -05:00
Chris O'Haver
911891f485 plugin/rewrite: Write failures with ResponseReverter (#5150)
* write failures with ResponseReverter instead of letting server write them

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

* fix comment

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-02-01 16:54:06 -05:00
soulfy
49ee97994e fix: convert key to domain (#5064)
fix convert key to domain when key ends with '/'
2022-02-01 09:45:43 -05:00
coredns[bot]
830a0f7dcb auto go fmt
Signed-off-by: coredns[bot] <bot@bot.coredns.io>
2022-01-31 10:27:19 +00:00
Chris O'Haver
49f0562f6c plugin/template: Persist truncated state to client if CNAME lookup response is truncated (#4713)
* persist truncated state to client if cname lookup response is truncated

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-01-26 15:49:44 -05:00
Ondřej Benkovský
f713a51319 plugin/prometheus: write rcode properly to the metrics (#5126)
* plugin/prometheus: write rcode properly to the metrics

Signed-off-by: Ondřej Benkovský <ondrej.benkovsky@jamf.com>
2022-01-26 11:32:01 -05:00
xuweiwei
1d3e901157 plugin/file: optimize cname get rr by type (#5080)
Signed-off-by: xuweiwei <xuweiwei_yewu@cmss.chinamobile.com>
2022-01-21 15:05:11 -08:00
Chris O'Haver
1c6b68f3cb tls.PreferServerCipherSuites is ignored as of go 1.17 (#5108)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-01-21 15:04:36 -08:00
coredns[bot]
1c4e8eb75d auto remove trailing whitespaces
Signed-off-by: coredns[bot] <bot@bot.coredns.io>
2022-01-11 10:34:21 +00:00
coredns[bot]
7d629a0b9e auto go fmt
Signed-off-by: coredns[bot] <bot@bot.coredns.io>
2022-01-10 10:28:56 +00:00
xuweiwei
56ee0efa69 plugin/file: add a test case for wildcard RRs do not apply (#5078)
From RFC 1034 ...

Wildcard RRs do not apply:
[...]

When the query name or a name between the wildcard domain and
the query name is know to exist. For example, if a wildcard
RR has an owner name of "*.X", and the zone also contains RRs
attached to B.X, the wildcards would apply to queries for name
Z.X (presuming there is no explicit information for Z.X), but
not to B.X, A.B.X, or X.

Signed-off-by: xuweiwei <xuweiwei_yewu@cmss.chinamobile.com>
2022-01-08 06:03:28 -08:00
Chris O'Haver
37c0fcf439 persist truncated state to client if lookup response is truncated (#4712)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-01-07 11:19:46 -05:00
Ondřej Benkovský
b546031f9b plugin/dns64 : add support for DNS requests over IPv4 network (#4809) 2022-01-07 11:16:23 -05:00
Ting Yuan
39a99a5bbe fix goroutine leaks in TestRoute53 (#5070)
Signed-off-by: Ting Yuan <yuanting@ict.ac.cn>
2022-01-05 05:20:32 -08:00
Ben Kochie
74f3bea50f Convert HostPortOrFile error to var (#5058)
Convert "no nameservers found" error on parse.HostPortOrFile() to an
exported var for use with `errors.Is()`.

Signed-off-by: SuperQ <superq@gmail.com>
2021-12-23 12:02:28 -05:00
Chris O'Haver
ca476cec30 add wildcard query deprection notice to kubernetes readme (#5045)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-12-17 16:57:32 -05:00
LiuCongran
4c051254fe fix invalid reload when multiple file plugins (#5020)
Signed-off-by: crliu3227 <liucongran327@163.com>
2021-12-09 08:43:10 -08:00
Chris O'Haver
744468ea78 add wildcard warnings (#5030)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-12-09 08:24:48 -08:00
jayonlau
e5ea3341fa Clean up extra spaces (#5027) 2021-12-08 08:26:14 -08:00
xuweiwei
b7b62b38ef plugin/kubernetes: clean code (#5017)
Signed-off-by: xuweiwei <xuweiwei_yewu@cmss.chinamobile.com>
2021-12-01 09:26:18 -05:00
xuweiwei
7e12327ab1 plugin/geoip: cleanup code (#5009)
remove unnecessary float64 convert and clean code

Signed-off-by: xuweiwei <xuweiwei_yewu@cmss.chinamobile.com>
2021-11-24 09:24:49 +01:00
Ondřej Benkovský
b8439789f4 support plain HTTP for DoH (#4997)
Signed-off-by: Ondřej Benkovský <ondrej.benkovsky@jamf.com>
2021-11-23 14:03:26 +01:00
OctoHuman
29f6d0a6b2 Docs: Add warning to use tls_servername (#4992)
Signed-off-by: OctoHuman <17958767+OctoHuman@users.noreply.github.com>
2021-11-22 08:49:13 +01:00
Miek Gieben
a9d9d2b71e plugin/bind: Point to MacOS bug (#4995)
Document this is a bug.

Closes: 4993

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-11-21 12:15:27 -05:00
gomakesix
71bb575b71 plugin/auto: Fix panic caused by config invalid reload value (#4986)
Automatically submitted.
2021-11-19 16:19:25 +00:00
xuweiwei
e799a0f5c7 plugin/file: Fix print tree error (#4962)
Automatically submitted.
2021-11-19 16:18:31 +00:00
xuweiwei
5f900b86f5 cleanup some code (#4989)
Automatically submitted.
2021-11-19 16:15:58 +00:00
xuweiwei
1029fea906 Fix a typo in plugin/health (#4982)
Signed-off-by: xuweiwei <xuweiwei_yewu@cmss.chinamobile.com>
2021-11-15 07:29:52 -05:00
coredns[bot]
92b0227592 auto go fmt
Signed-off-by: coredns[bot] <bot@bot.coredns.io>
2021-11-15 10:33:24 +00:00
Chris O'Haver
3288b111b2 Revert "Initial implementation of ForwardCRD plugin (#4512)" (#4981)
This reverts commit 2e6953c7db.
2021-11-12 13:19:16 -05:00
Christian Ang
2e6953c7db Initial implementation of ForwardCRD plugin (#4512)
* Add forwardcrd plugin README.md

Co-authored-by: Aidan Obley <aobley@vmware.com>

Signed-off-by: Christian Ang <angc@vmware.com>

* Create forwardcrd plugin

- Place forwardcrd before forward plugin in plugin list. This will avoid
forward from preventing the forwardcrd plugin from handling any queries
in the case of having a default upstream forwarder in a server block (as
is the case in the default kubernetes Corefile).

Co-authored-by: Aidan Obley <aobley@vmware.com>

Signed-off-by: Christian Ang <angc@vmware.com>

* Add Forward CRD

Signed-off-by: Christian Ang <angc@vmware.com>

* Add NewWithConfig to forward plugin

- allows external packages to instanciate forward plugins

Co-authored-by: Aidan Obley <aobley@vmware.com>

Signed-off-by: Christian Ang <angc@vmware.com>

* ForwardCRD plugin handles requests for Forward CRs

- add a Kubernetes controller that can read Forward CRs
- instances of the forward plugin are created based on Forward CRs from
the Kubernetes controller
- DNS requests are handled by calling matching Forward plugin instances
based on zone name
- Defaults to the kube-system namespace to align with Corefile RBAC

Signed-off-by: Christian Ang <angc@vmware.com>

Use klog v2 in forwardcrd plugin

* Refactor forward setup to use NewWithConfig

Co-authored-by: Christian Ang <angc@vmware.com>

Signed-off-by: Edwin Xie <exie@vmware.com>

* Use ParseInt instead of Atoi

- to ensure that the bitsize is 32 for later casting to uint32

Signed-off-by: Christian Ang <angc@vmware.com>

* Add @christianang to CODEOWNERS for forwardcrd

Signed-off-by: Christian Ang <angc@vmware.com>

Co-authored-by: Edwin Xie <exie@vmware.com>
2021-11-12 11:22:34 -05:00
Miek Gieben
6953ab2b4f Metrics: expand coredns_dns_responses_total with plugin label (#4914)
* Metrics: expand coredns_dns_responses_total with plugin label

This adds (somewhat hacky?) code to add a plugin label to the
coredns_dns_responses_total metric. It's completely obvlious to the
plugin as we just check who called the *recorder.WriteMsg method. We use
runtime.Caller( 1 2 3) to get multiple levels of callers, this should be
deep enough, but it depends on the dns.ResponseWriter wrapping that's
occuring.

README.md of metrics updates and test added in test/metrics_test.go to
check for the label being set.

I went through the plugin to see what metrics could be removed, but
actually didn't find any, the plugin push out metrics that make sense.

Due to the path fiddling to figure out the plugin name I doubt this
works (out-of-the-box) for external plugins, but I haven't tested that.

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

* better comment

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

* Metrics: expand coredns_dns_responses_total with plugin label

This adds (somewhat hacky?) code to add a plugin label to the
coredns_dns_responses_total metric. It's completely obvlious to the
plugin as we just check who called the *recorder.WriteMsg method. We use
runtime.Caller( 1 2 3) to get multiple levels of callers, this should be
deep enough, but it depends on the dns.ResponseWriter wrapping that's
occuring.

README.md of metrics updates and test added in test/metrics_test.go to
check for the label being set.

I went through the plugin to see what metrics could be removed, but
actually didn't find any, the plugin push out metrics that make sense.

Due to the path fiddling to figure out the plugin name I doubt this
works (out-of-the-box) for external plugins, but I haven't tested that.

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

* Update core/dnsserver/server.go

Co-authored-by: dilyevsky <ilyevsky@gmail.com>

* Use [3]string

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

* imports

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

* remove dnstest changes

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

* revert

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

* Add some sleeps to make it less flaky

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

* Revert "Add some sleeps to make it less flaky"

This reverts commit b5c6655196.

* Remove forward when not needed

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

* remove newline

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

Co-authored-by: dilyevsky <ilyevsky@gmail.com>
2021-11-12 16:07:05 +00:00
Chris O'Haver
29cae57932 plugin/loadbalance: More consistent shuffling (#4961)
* fix shuffling

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

* shuffle each record once

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-11-12 16:00:20 +00:00
xww
f6ffafe229 Fix a typo in plugin/geoip/README.md (#4978)
Signed-off-by: xuweiwei <xuweiwei_yewu@cmss.chinamobile.com>

Co-authored-by: xuweiwei <xuweiwei_yewu@cmss.chinamobile.com>
2021-11-10 21:20:40 -05:00
Matt Palmer
e53bff9043 plugin/route53: Configurable AWS Endpoint (#4963)
Provide the ability to configure the AWS endpoint

Signed-off-by: Matthew Palmer <matthew.palmer@helpsystems.com>
2021-11-08 06:45:45 -08:00