mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-24 18:55:55 +03:00
[PR #3491] DNSTAP logging support #3887
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#3887
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hickory-dns/hickory-dns/pull/3491
Author: @jpds
Created: 3/10/2026
Status: 🔄 Open
Base:
main← Head:feature/dnstap-support📝 Commits (10+)
ded72f4Add DNSTAP protobuf schema and build infrastructure0c38ab2Implement Frame Streams protocol client for DNSTAP transport17a3558Add DNSTAP protobuf message builder9acc750Add DNSTAP client with async channel-based message sending2d212bcIntegrate DNSTAP client into server request/response pipelineb46c6edAdd DNSTAP integration tests7b00221Add per-message-type DNSTAP configuration options5b5d867Add DNSTAP documentation to example config, README, and rustdoce174e28Add send_identity/send_version flags for DNSTAP110b6a3Fix clippy errors in DNSTAP implementation📊 Changes
28 files changed (+2892 additions, -42 deletions)
View changed files
📝
Cargo.lock(+215 -5)📝
Cargo.toml(+7 -0)📝
bin/Cargo.toml(+3 -1)📝
bin/src/config/mod.rs(+125 -0)📝
bin/src/hickory-dns.rs(+28 -16)📝
bin/src/lib.rs(+47 -0)➕
crates/dnstap/Cargo.toml(+36 -0)➕
crates/dnstap/proto/dnstap.proto(+343 -0)➕
crates/dnstap/src/client.rs(+358 -0)➕
crates/dnstap/src/dnstap_message.rs(+261 -0)➕
crates/dnstap/src/framestream.rs(+200 -0)➕
crates/dnstap/src/layer.rs(+267 -0)➕
crates/dnstap/src/lib.rs(+78 -0)➕
crates/dnstap/src/proto.rs(+509 -0)➕
crates/dnstap/tests/generate_dnstap.rs(+48 -0)📝
crates/server/Cargo.toml(+2 -0)📝
crates/server/README.md(+2 -0)📝
crates/server/src/lib.rs(+2 -0)📝
crates/server/src/server/h2_handler.rs(+1 -1)📝
crates/server/src/server/h3_handler.rs(+1 -1)...and 8 more files
📄 Description
This PR implements DNSTAP support for structured DNS event logging for Hickory, gated behind a new
dnstapCargo feature flag.It includes a vendored
dnstap.protoschema with prost-build code generation, a Frame Streams protocol client for framing and transport, a protobuf message builder that captures query/response wire bytes, and a DNSTAP-client with automatic reconnection (TCP and Unix socket endpoints are supported as connection types).The client is integrated into all server protocol handlers (UDP, TCP, DoH, DoH3, DoQ) and supports per-message-type enable flags for AUTH, CLIENT, and RESOLVER query/response events. Configuration is exposed via a new
[dnstap]TOML section, end-to-end integration tests verify correct frame delivery against a mock collector.The documentation has been updated in the README and example config.
The code was generated with the assistance of Claude, however - I have validated that the functionality works correctly by incorporating this into my existing
nixpkgsintegration test for Vector+DNSTAP here: https://github.com/NixOS/nixpkgs/compare/master...jpds:nixpkgs:nixos-tests-vector-dnstap-hickory and ensuring that the output which ends up in the ClickHouse database matches what Knot implements as well:Fixes: #11
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.