Commit Graph

4677 Commits

Author SHA1 Message Date
Ville Vesilehto
54b06d9a3b lint(revive): fix early-return violations (#7974) 2026-03-29 16:59:22 -07:00
Ville Vesilehto
ff954b12b2 lint: enable revive linter (#7973) 2026-03-29 00:04:28 -07:00
Minghang Chen
34acf8353f proxyproto: add UDP session tracking for Spectrum PPv2 (#7967) 2026-03-28 15:06:36 -07:00
Ingmar Van Glabbeek
12d9457e71 plugin/file: expand SVCB/HTTPS record support (#7950)
* plugin/file: expand SVCB/HTTPS record support

Add proper SVCB (type 64) and HTTPS (type 65) handling:

- Additional section processing: include A/AAAA glue for in-bailiwick
  SVCB/HTTPS targets, matching existing SRV/MX behavior
- Target name normalization: lowercase SVCB/HTTPS Target on zone insert,
  consistent with CNAME/MX handling
- Metrics: add TypeSVCB to monitored query types (TypeHTTPS was already
  present)
- Test helpers: add SVCB()/HTTPS() constructors and Section comparison
  cases
- Tests: basic queries with glue, AliasMode, wildcards, NoData, NXDOMAIN,
  target normalization, and DNS-AID private-use key (65400-65408)
  round-trip

Signed-off-by: Ingmar <ivanglabbeek@infoblox.com>

* plugin/file: simplify HTTPS target access via field promotion

dns.HTTPS embeds dns.SVCB, so .Target is directly accessible
without the redundant .SVCB. qualifier. Fixes gosimple S1027.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Ingmar <ivanglabbeek@infoblox.com>

---------

Signed-off-by: Ingmar <ivanglabbeek@infoblox.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 11:46:41 +02:00
Ilya Kulakov
a8caf4c375 plugin/tls: Add the keylog option to configure TLSConfig.KeyLogWriter (#7537)
* tls: Add the keylog option to configure TLSConfig.KeyLogWriter

Signed-off-by: Ilya Kulakov <kulakov.ilya@gmail.com>

* tls: Close keylog file on instance shutdown.

Signed-off-by: Ilya Kulakov <kulakov.ilya@gmail.com>

---------

Signed-off-by: Ilya Kulakov <kulakov.ilya@gmail.com>
2026-03-27 21:10:13 +02:00
Seena Fallah
471d62926d plugin/tsig: add require_opcode directive for opcode-based TSIG (#7828)
Extend the tsig plugin to require TSIG signatures based on DNS opcodes,
similar to the existing qtype-based requirement.

The new require_opcode directive accepts opcode names (QUERY, IQUERY,
STATUS, NOTIFY, UPDATE) or the special values "all" and "none".

This is useful for requiring TSIG on dynamic update (UPDATE) or zone
transfer notification (NOTIFY) requests while allowing unsigned queries.

Example:
```
  tsig {
    secret key. NoTCJU+DMqFWywaPyxSijrDEA/eC3nK0xi3AMEZuPVk=
    require_opcode UPDATE NOTIFY
  }
```

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
2026-03-27 21:05:49 +02:00
Ville Vesilehto
0918e88368 chore(docs): update Docker build command in README (#7972) 2026-03-26 20:37:35 -07:00
Ville Vesilehto
0132ad86b5 chore(docs): regenerate man pages (#7971) 2026-03-26 20:35:09 -07:00
Ville Vesilehto
49b18b8af6 test(dnssec): fix err in TestZoneSigningDouble (#7969) 2026-03-26 20:33:55 -07:00
John-Michael Mulesa
1c15569168 feat: add support for running CoreDNS as a Windows service (#7962)
* feat: add support for running CoreDNS as a Windows service

Signed-off-by: John-Michael Mulesa <jmulesa@gmail.com>

* Use non-deprecated service check function.

Signed-off-by: John-Michael Mulesa <jmulesa@gmail.com>

* refactor: remove deprecated build tags and clean up imports in service files

Signed-off-by: John-Michael Mulesa <jmulesa@gmail.com>

* ci: add Windows test workflow and fix log field access in service_windows.go

Signed-off-by: John-Michael Mulesa <jmulesa@gmail.com>

* test: implement cross-platform file permission restriction for Windows compatibility in run_test.go

Signed-off-by: John-Michael Mulesa <jmulesa@gmail.com>

* refactor: remove Windows-specific icacls test logic and restrict unreadable file test to non-Windows platforms

Signed-off-by: John-Michael Mulesa <jmulesa@gmail.com>

* docs: add documentation for -windows-service flag in man page

Signed-off-by: John-Michael Mulesa <jmulesa@gmail.com>

---------

Signed-off-by: John-Michael Mulesa <jmulesa@gmail.com>
2026-03-26 21:10:53 +02:00
Ville Vesilehto
12131b7455 ci: remove trivy-action (#7961) 2026-03-24 13:46:32 -07:00
Yong Tang
384be4cd8e core: Preserve TSIG status in gRPC transport (#7943) 2026-03-24 13:46:15 -07:00
Yong Tang
a025712827 plugin/transfter: Fix longestMatch to select the most specific zone correctly. (#7949)
* plugin/transfter: Fix longestMatch to select the most specific zone correctly.

This PR Fix longestMatch to select the most specific zone correctly.The previous implementation used lexicographic string comparison, which could choose the wrong zone; this change selects the longest matching zone instead.

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

* Tie breaker

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>
2026-03-24 20:35:20 +02:00
Ville Vesilehto
980b0fe16b ci(depsreview): add version comment to pin (#7966) 2026-03-24 10:31:25 -07:00
Ville Vesilehto
28617d8f30 ci(release): use env vars for expressions in shell (#7965) 2026-03-24 10:31:00 -07:00
Ville Vesilehto
b7948f1bac ci: add persist-credentials: false to checkouts (#7964) 2026-03-24 10:29:48 -07:00
rpb-ant
31e16025ef plugin/cache: prefetch without holding a client connection (#7944) 2026-03-24 08:47:11 -07:00
Syed Azeez
f582a01dc9 fix(kubernetes): record cluster_ip services in dns_programming_duration metric (#7951)
Signed-off-by: Azeez Syed <syedazeez337@gmail.com>
2026-03-24 05:29:28 -07:00
Ville Vesilehto
734426798f ci(dependabot): add 7-day cooldown for updates (#7960) 2026-03-24 00:59:24 -07:00
dependabot[bot]
80f6df8f12 build(deps): bump the go-etcd-io group with 2 updates (#7954) 2026-03-24 00:58:55 -07:00
dependabot[bot]
ec5b5c6006 build(deps): bump the k8s-io group with 3 updates (#7953) 2026-03-24 00:58:32 -07:00
Ville Vesilehto
95d6e177ee ci(yamllint): replace third-party action with uvx (#7957) 2026-03-24 00:58:19 -07:00
Ville Vesilehto
718bfe7e2d ci(docker): scope secrets to publish step only (#7959) 2026-03-24 00:57:50 -07:00
Ville Vesilehto
406be98739 ci: use go-version-file instead of GITHUB_ENV (#7958) 2026-03-24 00:57:20 -07:00
dependabot[bot]
540a50d900 build(deps): bump github.com/DataDog/dd-trace-go/v2 from 2.6.0 to 2.7.0 (#7955)
Bumps [github.com/DataDog/dd-trace-go/v2](https://github.com/DataDog/dd-trace-go) from 2.6.0 to 2.7.0.
- [Release notes](https://github.com/DataDog/dd-trace-go/releases)
- [Commits](https://github.com/DataDog/dd-trace-go/compare/v2.6.0...v2.7.0)

---
updated-dependencies:
- dependency-name: github.com/DataDog/dd-trace-go/v2
  dependency-version: 2.7.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-03-24 06:26:45 +02:00
dependabot[bot]
ca124299be build(deps): bump github/codeql-action from 4.33.0 to 4.34.1 (#7952)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.33.0 to 4.34.1.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](b1bff81932...3869755554)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.34.1
  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-03-23 16:01:53 +02:00
John-Michael Mulesa
92a6ae7079 Update github workflow to release windows builds in zip format. (#7946)
* feat: Add GitHub Actions workflow for drafting releases and update Makefile to build Windows releases as zip archives.

Signed-off-by: John-Michael Mulesa <jmulesa@gmail.com>

* Generate both tgz and zip for Windows to support any existing workflows.

Signed-off-by: John-Michael Mulesa <jmulesa@gmail.com>

---------

Signed-off-by: John-Michael Mulesa <jmulesa@gmail.com>
2026-03-21 20:21:12 -07:00
Yong Tang
e8db7e155e Core: Propagate TSIG status in DoQ transport (#7947)
This PR nsure DoQ writer preserves and returns TSIG verification status, preventing authentication bypass on DNS-over-QUIC.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2026-03-20 22:08:19 +02:00
dependabot[bot]
68a8f46129 build(deps): bump google.golang.org/grpc from 1.79.2 to 1.79.3 (#7945) 2026-03-18 20:00:26 -07:00
Yong Tang
f67994442a core: Reject oversized GET dns query parameter of DoH (#7926)
* core: Reject oversized GET dns query parameter of DoH

The DoH POST path limits request size using http.MaxBytesReader(..., 65536), but the GET path passes the dns query value directly to base64ToMsg() with no equivalent bound.

This PR adds length check.

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>
2026-03-18 09:38:44 +02:00
Ville Vesilehto
ece6a68b04 docs(cache): clarify TTL directive (#7941) 2026-03-17 11:55:11 -07:00
dependabot[bot]
3c1dc105d2 build(deps): bump github.com/aws/aws-sdk-go-v2/service/secretsmanager (#7935) 2026-03-16 15:56:00 -07:00
Ville Vesilehto
5a63eb61a3 fix(file): protect Zone.Expired with mutex (#7940) 2026-03-16 14:08:03 -07:00
dependabot[bot]
30ab93b5be build(deps): bump github.com/aws/aws-sdk-go-v2/service/route53 (#7937) 2026-03-16 14:07:02 -07:00
dependabot[bot]
e2e345b9d4 build(deps): bump github.com/aws/aws-sdk-go-v2/config (#7932) 2026-03-16 13:02:31 -07:00
dependabot[bot]
c4d59e7e42 build(deps): bump google.golang.org/api from 0.269.0 to 0.271.0 (#7933) 2026-03-16 13:02:20 -07:00
dependabot[bot]
b79b932af2 build(deps): bump golang.org/x/net from 0.51.0 to 0.52.0 (#7936) 2026-03-16 11:16:35 -07:00
dependabot[bot]
dde5183127 build(deps): bump github.com/aws/aws-sdk-go-v2 from 1.41.3 to 1.41.4 (#7938) 2026-03-16 11:15:49 -07:00
dependabot[bot]
4eca62f38a build(deps): bump golang.org/x/crypto from 0.48.0 to 0.49.0 (#7939) 2026-03-16 11:15:30 -07:00
Yong Tang
5bbe053c33 core: Avoid spawning waiter goroutines when QUIC worker pool is full (#7927) 2026-03-16 10:37:48 -07:00
dependabot[bot]
2be910ef1c build(deps): bump softprops/action-gh-release from 2.5.0 to 2.6.1 (#7930)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.5.0 to 2.6.1.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](a06a81a03e...153bb8e044)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: 2.6.1
  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-03-16 17:21:00 +02:00
dependabot[bot]
43f07e78ec build(deps): bump github/codeql-action from 4.32.6 to 4.33.0 (#7929)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.32.6 to 4.33.0.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](0d579ffd05...b1bff81932)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.33.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-03-16 17:20:44 +02:00
Yong Tang
25d1ab9462 core: Propagate TSIG secrets to DoT server (#7928) 2026-03-16 06:42:38 -07:00
Yong Tang
c0d676e026 Fix case-sensitive zone handling in the transfer plugin for AXFR/IXFR. (#7899)
This PR fixes Fix case-sensitive zone handling in the transfer plugin for AXFR/IXFR, raised in 7898

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2026-03-15 14:27:03 -07:00
Ville Vesilehto
6819d2ca6c refactor(test): replace deprecated pbutil dep (#7924)
Replace github.com/matttproud/golang_protobuf_extensions/pbutil
with google.golang.org/protobuf/encoding/protodelim for reading
varint size-delimited protobuf messages in the metrics scraper.

The new protodelim package is already available via the existing
google.golang.org/protobuf dependency, so this removes pbutil as
a direct dependency entirely.

Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
2026-03-15 21:35:59 +02:00
Peppi-Lotta
7ff001dca7 Add optional TLS support to /metrics endpoint (#7255)
* Use exporter-toolkit to enable optional TLS encryption on /metrics endpoint

Signed-off-by: peppi-lotta <peppi-lotta.saari@est.tech>

* Implement startup listener to signal server readiness

Signed-off-by: peppi-lotta <peppi-lotta.saari@est.tech>

---------

Signed-off-by: peppi-lotta <peppi-lotta.saari@est.tech>
2026-03-12 13:49:00 -07:00
dependabot[bot]
a8c802e1b3 build(deps): bump github.com/aws/aws-sdk-go-v2/config (#7915) 2026-03-09 16:20:24 -07:00
dependabot[bot]
d8f196c24e build(deps): bump github.com/aws/aws-sdk-go-v2/feature/ec2/imds (#7914) 2026-03-09 13:53:24 -07:00
cangming
500707c43a plugin/forward: add max_age option to enforce an absolute connection lifetime (#7903)
* plugin/pkg/proxy: add max_age for per-connection lifetime cap

Introduce a max_age setting on Transport that closes connections based
on creation time, independent of idle-timeout (expire).

Background: PR #7790 changed the connection pool from LIFO to FIFO for
source-port diversity. Under FIFO, every connection is cycled through
the pool and its used timestamp is refreshed continuously. When request
rate is high enough that pool_size / request_rate < expire, no
connection ever becomes idle and expire never fires. This prevents
CoreDNS from opening new connections to upstreams that scale out (e.g.
new Kubernetes pods behind a ClusterIP service with conntrack pinning).

max_age addresses this by enforcing an absolute upper bound on
connection lifetime regardless of activity:
- persistConn gains a created field set at dial time.
- Transport gains maxAge (default 0 = unlimited, preserving existing
  behaviour).
- Dial(): rejects cached connections whose creation age exceeds max_age.
- cleanup(): when maxAge > 0, uses a linear scan over both idle-timeout
  and max-age predicates; when maxAge == 0, preserves the original
  binary-search path on used time (sorted by FIFO insertion order).
- Both hot paths pre-compute the deadline outside any inner loop to
  avoid repeated time.Now() calls.

Tests added:
- TestMaxAgeExpireByCreation: connection with old created but fresh used
  must be rejected even though idle-timeout would pass.
- TestMaxAgeFIFORotation: three FIFO-rotated connections (old created,
  fresh used) must all be rejected, confirming that continuous rotation
  cannot prevent max-age expiry.

Signed-off-by: cangming <cangming@cangming.app>

* plugin/forward: add max_age option

Expose Transport.SetMaxAge through the forward plugin so operators can
set an absolute upper bound on connection lifetime via the Corefile.

Usage:
  forward . 1.2.3.4 {
      max_age 30s
  }

Default is 0 (unlimited), which preserves existing behaviour.
A positive value causes connections older than max_age to be closed and
re-dialled on the next request, ensuring CoreDNS reconnects to newly
scaled-out upstream pods even under sustained load where the idle
timeout (expire) would never fire.

If max_age is set, it must not be less than expire; the parser rejects
this combination at startup with a clear error message.

Signed-off-by: cangming <cangming@cangming.app>

---------

Signed-off-by: cangming <cangming@cangming.app>
2026-03-09 11:50:03 -07:00
dependabot[bot]
bbd54ad288 build(deps): bump github.com/aws/aws-sdk-go-v2/service/route53 (#7917)
Bumps [github.com/aws/aws-sdk-go-v2/service/route53](https://github.com/aws/aws-sdk-go-v2) from 1.62.2 to 1.62.3.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/fsx/v1.62.2...service/fsx/v1.62.3)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/service/route53
  dependency-version: 1.62.3
  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-03-09 11:48:44 -07:00