Commit Graph

4886 Commits

Author SHA1 Message Date
houyuwushang
1e01c0ad7c plugin/secondary: serve catalog member zones (#8230)
Signed-off-by: houyuwushang <liuluoqianqiu@outlook.com>
2026-07-09 17:42:30 -07:00
Filippo125
e4990abfa3 feat(forward): add source_address directive (#8011)
* fix(dnssec): avoid caching empty signing results (#7996)

Signed-off-by: Filippo <filippo.ferrazini@gmail.com>

* save only

Signed-off-by: Filippo <filippo.ferrazini@gmail.com>

* do #8008

Signed-off-by: Filippo <filippo.ferrazini@gmail.com>

* Fix Address used if tcp

Signed-off-by: Filippo <filippo.ferrazini@gmail.com>

* Fix bad using of dialer type

Signed-off-by: Filippo <filippo.ferrazini@gmail.com>

* core: Add full TSIG verification in gRPC transport (#8006)

* core: Add full TSIG verification in gRPC transport

This PR add full TSIG verification in gRPC using dns.TsigVerify() so invalid signatures and timestamps are correctly detected instead of only checking key presence.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Fix

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Fix

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

---------

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Signed-off-by: Filippo <filippo.ferrazini@gmail.com>

* core: Add full TSIG verification in QUIC transport (#8007)

* core: Add full TSIG verification in QUIC transport

This PR add full TSIG verification in QUIC using dns.TsigVerify()

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Fix

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

---------

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Signed-off-by: Filippo <filippo.ferrazini@gmail.com>

* fix(test): deduplicate TSIG test helpers (#8009)

Signed-off-by: Filippo <filippo.ferrazini@gmail.com>

* fix(dnssec): return nil sigs on sign error (#7999)

Signed-off-by: Filippo <filippo.ferrazini@gmail.com>

* fix(dnssec): return nil from ParseKeyFile on error (#8000)

Signed-off-by: Filippo <filippo.ferrazini@gmail.com>

* fix(dnsserver): allow view server blocks in any declaration order (#8001)

When using the view plugin, filtered and unfiltered server blocks can
share the same zone and port. The zone overlap validation rejected this
configuration when the unfiltered block was not declared last, because
filtered configs treated an already-registered zone as an error.

Skip the 'already defined' check for configs that have filter functions,
since they are expected to coexist with an unfiltered catch-all block on
the same zone/port.

Fixes #7733

Signed-off-by: umut-polat <52835619+umut-polat@users.noreply.github.com>
Signed-off-by: Filippo <filippo.ferrazini@gmail.com>

* fix(doh): use per-connection local address for PROXY protocol (#8005)

Signed-off-by: Filippo <filippo.ferrazini@gmail.com>

* fix(transfer): batch AXFR records by message size instead of count (#8002)

Signed-off-by: Filippo <filippo.ferrazini@gmail.com>

* fix(tls): use temp dir for keylog test path (#8010)

Signed-off-by: Filippo <filippo.ferrazini@gmail.com>

* Rename local_address option to source_address

Signed-off-by: Filippo <filippo.ferrazini@gmail.com>

* Rename local_address also in readme
Add test

Signed-off-by: Filippo <filippo.ferrazini@gmail.com>

* Resolve change request in pr

Signed-off-by: Filippo <filippo.ferrazini@gmail.com>

* fix ci lint

Signed-off-by: Filippo <filippo.ferrazini@gmail.com>

* Improve doc on source_address routing needs

Signed-off-by: Filippo <filippo.ferrazini@gmail.com>

* Remove added timeout

Signed-off-by: Filippo <filippo.ferrazini@gmail.com>

* add use of source address also for health check query

Signed-off-by: Filippo <filippo.ferrazini@gmail.com>

* remove untrailing newline from health_test.go

Signed-off-by: Filippo <filippo.ferrazini@gmail.com>

* fix file format

Signed-off-by: Filippo <filippo.ferrazini@gmail.com>

* Update plugin/forward/setup_test.go

Co-authored-by: Ville Vesilehto <ville@vesilehto.fi>
Signed-off-by: Filippo <filippo.ferrazini@gmail.com>

* Remove dead code in TestHealthLocalAddress

Signed-off-by: Filippo <filippo.ferrazini@gmail.com>

* Fix misspelling

Signed-off-by: Filippo <filippo.ferrazini@gmail.com>

* Try to set default timeout

Signed-off-by: Filippo <filippo.ferrazini@gmail.com>

* fix format in health.go

Signed-off-by: Filippo <filippo.ferrazini@gmail.com>

---------

Signed-off-by: Filippo <filippo.ferrazini@gmail.com>
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Signed-off-by: umut-polat <52835619+umut-polat@users.noreply.github.com>
Co-authored-by: Ville Vesilehto <ville@vesilehto.fi>
Co-authored-by: Yong Tang <yong.tang.github@outlook.com>
Co-authored-by: Umut Polat <52835619+umut-polat@users.noreply.github.com>
Co-authored-by: Cedric Wang <wangzongqi@msn.com>
2026-07-09 17:38:22 -07:00
Yong Tang
adba3b3703 Update Release Note 1.14.5 (#8264)
This PR Update Release Note for 1.14.5 (See 8228)

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
v1.14.5
2026-07-09 16:49:26 -07:00
Ilya Kulakov
540e2f325f plugin/tsig: don't echo client's TSIG.Error if verification is successful (#8215) 2026-07-09 15:04:23 -07:00
Ville Vesilehto
0ebe4da2b0 docs(timeouts): document DoQ read timeout (#8263) 2026-07-09 15:01:59 -07:00
Ville Vesilehto
6d13ab20af chore: update release notes for 1.14.5 (#8262) 2026-07-09 15:01:31 -07:00
Pavel Lazureykis
974d693e6f plugin/dnstap: fix self-deadlock in listener broadcast on client flush error (#8260)
listener.Dnstap holds clientsMu.RLock() while iterating connected sink
clients. In the flush-error branch it called removeClient(c) synchronously,
but removeClient takes clientsMu.Lock(). A sync.RWMutex is not reentrant, so
the goroutine blocks forever waiting to acquire the write lock it can never
get while holding the read lock. The queued Lock() then blocks every
subsequent Dnstap broadcast and close(), and the goroutine leaks.

A flush error is the normal failure mode for a slow or disconnected sink
client (writeMsg buffers into framestream and succeeds; flush does the real
socket write and fails), so a single misbehaving client wedged the whole
listen path. Because Dnstap runs inline in the request-serving goroutine via
TapMessageWithMetadata, this could cascade into stalled request handling.

The write-error branch one line up already offloaded with `go removeClient(c)`.
Do the same in the flush-error branch and drop the early return so the
broadcast still reaches the remaining clients.

Assisted-by: Claude Opus 4.8

Signed-off-by: Pavel Lazureykis <pavel@lazureykis.dev>
2026-07-09 20:43:35 +03:00
Omkhar Arasaratnam
9fac0b6e9e core/dnsserver: bound DoQ stream read with the server read timeout (#8231)
serveQUICStream acquires a worker from streamProcessPool and then calls
readDOQMessage with no read deadline. A client that opens a QUIC stream
but never (or only slowly) sends its DoQ query blocks that worker
indefinitely. With enough such streams this starves the worker pool and
stalls DoQ service for other clients, a remotely triggerable denial of
service that needs no authentication.

Set a per-stream read deadline before readDOQMessage, bounded by the
server's existing ReadTimeout (the same deadline used to read a query on
TCP, default 3s), so a stalled stream cannot hold a worker forever. A
deadline hit surfaces as a read error handled by the existing error path,
which closes the connection and frees the worker; the normal fast path is
unchanged.

Adds a regression test proving a stalled stream no longer starves the
single-worker pool while a well-behaved query is still served.

Signed-off-by: Omkhar Arasaratnam <omkhar@linkedin.com>
Co-authored-by: Omkhar Arasaratnam <omkhar@linkedin.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 20:37:57 +03:00
Yong Tang
ab318db7b4 plugin/transfer: Fix panic in CoreDNS transfer plugin caused by empty DNS record (#8207)
This PR fixes panic in CoreDNS transfer plugin caused by empty DNS record.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2026-07-09 20:21:45 +03:00
rpb-ant
2d106be341 core/dnsserver: add Config.UDPDecorateWriterFunc for external plugins (#8257)
* core/dnsserver: add Config.UDPDecorateWriterFunc for external plugins

Allow external plugins to install a dns.DecorateWriter (an existing
miekg/dns Server field CoreDNS never sets) on plain-UDP servers, e.g.
for per-socket write disciplines or overload protection; UDP is the
only transport without a Max*-style concurrency setting.

The field is a factory called once per Server in ServePacket, so each
socket gets its own decorator under multisocket; the *Server argument
is the same value handlers see via ctx.Value(dnsserver.Key{}). Follows
the Config.HTTPRequestValidateFunc precedent, including server-block
propagation and the ServePacket-time lookup over s.zones. Nil (the
default) changes nothing.

Signed-off-by: Ryan Brewster <rpb@anthropic.com>

* core/dnsserver: select UDP writer decorator deterministically in NewServer

Review feedback: s.zones is a map, so choosing the decorator in
ServePacket was non-deterministic when several server blocks share a
listener. Select it in NewServer from the group slice instead (stable
config order, last one set wins) and document the resolution order.

Signed-off-by: Ryan Brewster <rpb@anthropic.com>

* core/dnsserver: group decorator selection with the other last-writer-wins fields

Pure move: place it next to ProxyProtoConnPolicy, the existing field
resolved the same way at the same point.

Signed-off-by: Ryan Brewster <rpb@anthropic.com>

---------

Signed-off-by: Ryan Brewster <rpb@anthropic.com>
2026-07-09 20:15:13 +03:00
Pavel Lazureykis
7df9238255 plugin/kubernetes: fix AXFR panic when nsAddrs returns multiple records (#8256) 2026-07-09 01:45:30 -07:00
Pavel Lazureykis
9bf5de8e92 plugin/hosts: fix data race between lookups and reload (#8253)
LookupStaticHostV4/V6 dereferenced h.hmap and h.inline as call arguments,
which are evaluated before lookupStaticHostFamily takes the read lock. The
reload path (readHosts) swaps h.hmap under h.Lock() on every reload, so the
field read raced the swap for every A/AAAA lookup. This was introduced when
wildcard support (#8185) refactored these methods to pass the maps as
parameters; LookupStaticAddr still reads the fields inside the lock and was
unaffected.

Read h.hmap/h.inline inside the RLock by selecting the address family with a
bool instead of passing pre-dereferenced maps.

Also read h.mtime under the existing RLock in readHosts: it was read without a
lock while the reload writes it under h.Lock(), and readHosts runs from both
the OnStartup handler and the reload ticker goroutine.

Both races are confirmed by go test -race.

Signed-off-by: Pavel Lazureykis <pavel@lazureykis.dev>
2026-07-08 21:44:16 -07:00
Yong Tang
ea99084dec Update Release Note 1.14.5 (#8258)
This PR updates release note 1.14.5, part of 8228

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2026-07-08 21:40:23 -07:00
Cedric Wang
534f668ac9 core/dnsserver: sanitize DoH/DoH3 request parse errors (#8254)
The DoH (HTTP/2) and DoH3 (HTTP/3) handlers wrote the raw parse error
returned by doh.RequestToMsgWire directly into the HTTP 400 response
body via http.Error(w, err.Error(), ...).

When the request body read fails mid-stream (for example the server's
ReadTimeout firing on a slow client, or a connection reset),
io.ReadAll(http.MaxBytesReader(...)) returns a *net.OpError whose text
embeds the server's own listen socket, e.g.

    read tcp 10.0.0.1:5443->10.0.0.2:48418: i/o timeout

That discloses the server's internal bind address and port to any
unauthenticated remote caller who can trigger a body-read error.

Log the underlying error at debug level and return a generic
"invalid request" body to the client instead, matching the fixed-string
responses already used for the 404 and 500 cases in the same handlers.
Add tests asserting the response body no longer contains the raw read
error or an internal address.

Signed-off-by: zongqi-wang <wangzongqi@msn.com>
2026-07-08 18:07:01 -07:00
dependabot[bot]
658b2df2e9 build(deps): bump github.com/pires/go-proxyproto from 0.12.0 to 0.13.0 (#8243)
Bumps [github.com/pires/go-proxyproto](https://github.com/pires/go-proxyproto) from 0.12.0 to 0.13.0.
- [Release notes](https://github.com/pires/go-proxyproto/releases)
- [Commits](https://github.com/pires/go-proxyproto/compare/v0.12.0...v0.13.0)

---
updated-dependencies:
- dependency-name: github.com/pires/go-proxyproto
  dependency-version: 0.13.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-08 20:51:50 +03:00
dependabot[bot]
9ded9a70c1 build(deps): bump github.com/aws/aws-sdk-go-v2/service/route53 (#8242)
Bumps [github.com/aws/aws-sdk-go-v2/service/route53](https://github.com/aws/aws-sdk-go-v2) from 1.63.3 to 1.63.4.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.63.3...service/ecs/v1.63.4)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/service/route53
  dependency-version: 1.63.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-08 20:51:13 +03:00
dependabot[bot]
04b532fb65 build(deps): bump google.golang.org/grpc from 1.81.1 to 1.82.0 (#8244)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.81.1 to 1.82.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.81.1...v1.82.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-version: 1.82.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-08 20:50:40 +03:00
dependabot[bot]
ca27d5d073 build(deps): bump github.com/aws/aws-sdk-go-v2/config (#8251) 2026-07-08 18:08:59 +03:00
dependabot[bot]
9766801215 build(deps): bump github.com/aws/aws-sdk-go-v2/service/secretsmanager (#8245) 2026-07-08 18:08:27 +03:00
dependabot[bot]
a267ab2093 build(deps): bump github.com/prometheus/exporter-toolkit (#8250) 2026-07-08 17:44:12 +03:00
dependabot[bot]
56f36fa5fe build(deps): bump github.com/aws/aws-sdk-go-v2/credentials (#8246) 2026-07-08 17:43:10 +03:00
dependabot[bot]
e4d480f5ab build(deps): bump golang.org/x/sys from 0.46.0 to 0.47.0 (#8247) 2026-07-08 17:42:09 +03:00
dependabot[bot]
034de584b9 build(deps): bump github.com/DataDog/dd-trace-go/v2 from 2.9.0 to 2.9.1 (#8248) 2026-07-08 17:41:37 +03:00
dependabot[bot]
b376a785ae build(deps): bump golangci/golangci-lint-action from 9.2.1 to 9.3.0 (#8241) 2026-07-08 17:31:47 +03:00
Omkhar Arasaratnam
19ce0e173a plugin/dnstap: close the previous connection before reconnecting (#8224) 2026-07-08 05:58:55 -07:00
SEONGHYUN HONG
b1a0d2f287 plugin/erratic: apply default truncate amount of 2 for bare truncate (#8240) 2026-07-08 05:37:33 -07:00
Yong Tang
e81066b3e4 Bump version to 1.14.5 (#8238) 2026-07-08 06:02:34 +03:00
Yong Tang
2428ea65e2 Bump go version to 1.26.5 (#8237) 2026-07-08 06:01:51 +03:00
Yong Tang
84849690a4 Test: Fix flaky health test (#8239) 2026-07-08 06:00:40 +03:00
houyuwushang
6662dd58ea plugin/pkg/response: classify nxdomain without soa as denial (#8199)
Signed-off-by: houyuwushang <liuluoqianqiu@outlook.com>
2026-07-05 22:48:51 -07:00
Saleh
31559f43e8 plugin/file: return SOA in authority for negative CNAME target answers (#8226) 2026-07-05 00:39:15 -07:00
Aaron Mark
ea19f815a6 plugin/forward: make per-upstream read timeout configurable (#8205) 2026-07-04 17:07:04 -07:00
houyuwushang
97e3a71afb plugin/secondary: parse catalog zones after transfer (#8209) 2026-07-04 17:06:05 -07:00
Omkhar Arasaratnam
9226f8a3aa plugin/pkg/dnsutil: guard Join against an empty label slice (#8225) 2026-07-04 17:02:53 -07:00
Saleh
7abc21bc49 plugin/file: run additional processing for wildcard answers (#8222)
* plugin/file: run additional processing for wildcard answers

The wildcard branch of Zone.Lookup returned a nil additional section, so a
wildcard-synthesized MX/SRV/SVCB/HTTPS answer with an in-bailiwick target
did not include the target's A/AAAA glue. The non-wildcard path already
does this, so call additionalProcessing in the wildcard branch as well.

Fixes #6629

Signed-off-by: Salih Muhammed <root@lr0.org>

* plugin/file: move wildcard additional test into wildcard_test.go

Requested in review: keep the wildcard tests in one file.

Signed-off-by: Salih Muhammed <root@lr0.org>

---------

Signed-off-by: Salih Muhammed <root@lr0.org>
2026-07-04 16:07:01 -07:00
Ville Vesilehto
bc4343b083 fix(tls): use Go TLS defaults (#8227)
Remove fixed TLS 1.2 cipher suite list and maximum TLS version so
crypto/tls can use its maintained defaults. Keep TLS 1.2 as the
minimum supported version.

Document the shared TLS default behavior for plugins that expose TLS
configuration and add coverage to ensure CoreDNS leaves Go-managed
TLS fields unset.

Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
2026-07-04 16:03:02 -07:00
houyuwushang
679f764ae1 plugin/secondary: stop update loop on reload shutdown (#8198) 2026-07-02 06:46:03 -07:00
Antoine
3a4b87bdb4 fix(8201): restore old behavior forward plugin continue on empty conf file (#8203) 2026-07-01 23:11:37 -07:00
Jaime Hablutzel
8d94712f99 fix(forward): make dnstap FORWARDER_* describe the socket from CoreDNS to upstream (#8184)
Signed-off-by: Jaime Hablutzel <hablutzel1@gmail.com>
2026-07-01 21:04:04 -07:00
Baltasar Blanco
6e7093cafb plugin/cache: add regression test for AD bit not partitioning the cache (#8214)
The cache key is hashed on qname, qtype, DO and CD, but deliberately not on the AD bit, so a single entry serves both AD- and non-AD-requesting clients. The AD bit returned must therefore be derived per request from the cached answer's authentication status, not frozen from the query that populated the entry.

This pins both orderings (noad-then-ad and ad-then-noad) so the historical asymmetry reported in #6642 cannot regress.

Signed-off-by: baltasarblanco <baltablanco9008@gmail.com>
2026-07-01 15:46:49 -07:00
dependabot[bot]
6b9936a99f build(deps): bump github.com/DataDog/dd-trace-go/v2 from 2.8.2 to 2.9.0 (#8218)
Bumps [github.com/DataDog/dd-trace-go/v2](https://github.com/DataDog/dd-trace-go) from 2.8.2 to 2.9.0.
- [Release notes](https://github.com/DataDog/dd-trace-go/releases)
- [Commits](https://github.com/DataDog/dd-trace-go/compare/v2.8.2...v2.9.0)

---
updated-dependencies:
- dependency-name: github.com/DataDog/dd-trace-go/v2
  dependency-version: 2.9.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-01 15:45:53 -07:00
dependabot[bot]
85d5ec7974 build(deps): bump actions/setup-go from 6.4.0 to 6.5.0 (#8219) 2026-07-01 18:16:45 +03:00
dependabot[bot]
9ac3acb006 build(deps): bump softprops/action-gh-release from 3.0.0 to 3.0.1 (#8220) 2026-07-01 18:16:27 +03:00
Immanuel Tikhonov
33266a45c7 fix(rewrite): restore the original question on empty replies (#8212)
Signed-off-by: immanuwell <pchpr.00@list.ru>
2026-06-30 07:05:12 -04:00
houyuwushang
4faf983fb6 plugin/auto: warn on duplicate zone file origins (#8191)
Signed-off-by: houyuwushang <liuluoqianqiu@outlook.com>
2026-06-29 00:59:23 -07:00
Immanuel Tikhonov
70f7922ec5 test: use dynamic ports in reload tests (#8206)
Signed-off-by: immanuwell <pchpr.00@list.ru>
2026-06-29 00:58:46 -07:00
houyuwushang
02f28345d1 plugin/transfer: configure notify source address (#8192)
Signed-off-by: houyuwushang <liuluoqianqiu@outlook.com>
2026-06-28 21:15:16 -07:00
Immanuel Tikhonov
45a20ddcf1 fix: accept scoped IPv6 addresses in transfer targets (#8204)
Signed-off-by: immanuwell <pchpr.00@list.ru>
2026-06-27 22:26:12 -07:00
Immanuel Tikhonov
69e7a4be73 fix(trace): correct Zipkin v2 endpoint docs (#8202) 2026-06-27 03:21:26 -07:00
Immanuel Tikhonov
1539f9b7d6 fix(log): synthesize deferred error responses (#8200)
Signed-off-by: immanuwell <pchpr.00@list.ru>
2026-06-26 01:58:20 -07:00