Skip to content

feat(dialtesting): add DNS probes and encrypted transports - #212

Merged
leecha merged 3 commits into
mainfrom
feat-dns-dialtesting
Nov 4, 2026
Merged

leecha merged 3 commits into
mainfrom
feat-dns-dialtesting

Conversation

@NaR82n

@NaR82n NaR82n commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

DNS tasks can now query a configured resolver over UDP/TCP, DoT, DoH (HTTP/1.1, HTTP/2 or HTTP/3), or DoQ using the existing task lifecycle and reporting contract. Resolver hostnames, IPv4/IPv6, pinned addresses, certificate validation and mTLS share one cancellable timeout; automatic TCP fallback happens only for truncated UDP responses.

Adds A/AAAA/CNAME/MX/NS/TXT conditions with flat AND/OR semantics, DNSSEC request flags and AD assertions, bounded query/assertion JSON details, and credential redaction. Protocol failures cannot pass through OR or timing conditions. Rejects JSON-null task payloads without panicking. Includes the existing x/net version's DNS codec in vendor without changing dependency versions. Usage and result semantics are documented in dialtesting/DNS.md.

Validation:

  • Full make test passes on Go 1.27 and on the CI Go 1.25 toolchain with WITHIN_GITHUB_WORKFLOW=true.
  • CI toolchain make lint LINT_FIX=false passes with golangci-lint v2.4.0; go build ./... passes.
  • DNS race tests pass for 20 consecutive runs on Go 1.27 and 10 runs on Go 1.25.
  • Local UDP/TCP/TLS/HTTPS/QUIC fixtures cover fallback, all record types, AND/OR and empty sets, AD/DO/CD, mTLS, strict HTTP/2, malformed DoQ frames/IDs, redirects, deadlines/cancellation, IPv6, secure values, template validation and truncation without changing the verdict.
  • New DNS implementation statement coverage: 90.9% across the four production DNS files.
  • Windows/amd64 go build ./dialtesting passes. Local DataKit and Kodo integration regressions also pass against this implementation.

Repository-wide copyright checking still reports pre-existing header issues outside this change; all new Go files have the required headers.

Compatibility follow-up (29d53db):

  • Existing ITask/TaskChild interfaces, shared task fields, legacy protocol implementations, dependency versions and existing result contracts remain unchanged.
  • Fixes are confined to DNS: preserve DoH port templates through validation and per-region task copies; redact secure literals in reported task JSON with valid escaping and refreshed per-run sanitization; mark shortened TXT values and assertion details without changing the verdict.
  • Adds regression cases for matching/mismatching template ports, escaped secure values, security classification changes between runs, and short/long TXT results.
  • Existing dialtesting tests pass with the race detector when excluding TestTraceroute. That test exposes an unchanged race between the two writers in traceroute_other.go; the same race was reproduced against the PR base. This PR does not change that implementation.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


zhangwenjie seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@leecha
leecha merged commit 5ca9fcd into main Nov 4, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants