mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 11:15:54 +03:00
[PR #3070] [MERGED] hickory-dns: implement RFC 5001 NSID for auth. server #3539
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#3539
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/3070
Author: @cpu
Created: 6/19/2025
Status: ✅ Merged
Merged: 6/20/2025
Merged by: @djc
Base:
main← Head:cpu-nsid_dev📝 Commits (6)
1df6c21proto/rr: add EdnsOption::NSID4b924a9server/authority: inline send_response helper37087a1server/authority: response EDNS as MessageResponseBuilder arga8f6eb8tests/integration: rm superfluous Query type annotation73687e7server/authority: process EDNS NSID request5e87d03hickory-dns: add --nsid and --nsid-hostname args📊 Changes
9 files changed (+385 additions, -101 deletions)
View changed files
📝
Cargo.lock(+24 -5)📝
Cargo.toml(+2 -0)📝
bin/Cargo.toml(+2 -0)📝
bin/src/hickory-dns.rs(+67 -0)📝
crates/proto/src/rr/rdata/opt.rs(+65 -1)📝
crates/server/src/authority/catalog.rs(+80 -80)📝
crates/server/src/authority/message_response.rs(+5 -4)📝
crates/server/src/server/mod.rs(+1 -1)📝
tests/integration-tests/tests/integration/catalog_tests.rs(+139 -10)📄 Description
Description
RFC 5001 "DNS Name Server Identifier (NSID) Option" specifies a mechanism where clients can ask an authoritative or recursive server to include an identifier for the server that processed the request in the generated response.
Clients opt-in via sending an NSID EDNS option (0x03) with an empty value in outbound requests, and if the processing server has an NSID it includes EDNS data in the response with the same NSID EDNS option, but using the unstructured binary identifier as the option value. This can be helpful information when using DNS anycast, load balancing, or some other configuration that means it's not trivial to know ahead of time which particular nameserver handled a request.
This branch implements NSID support for the
hickory-dnsauthoritative server binary. The nameserver ID can be set in two ways:--nsid-hostnameto use the system hostname as the identifier--nsid <value>to use a specific identifier value, e.g.--nsid HickoryDNSSince the NSID payload is arbitrary binary data, the
--nsid <value>argument can be prefixed with0xto treat it as hex encoded data (e.g.--nsid 0xC0FFEE).By default, no NSID is configured, matching the status quo. Some nameservers (e.g.
knot) default to--nsid-hostnameunless NSID is specifically disabled, but to me this seems like a risky default and so I've made it opt-in. Happy to revisit if folks disagree.Examples
Using a string NSID:
Running with
hickory-dns --config config.toml --zonedir . --port 5454 --nsid "Hello World!":Using a hex NSID:
Running with
hickory-dns --config config.toml --zonedir . --port 5454 --nsid "0xC0FFEE":Using the hostname as NSID:
Running with `hickory-dns --config config.toml --zonedir . --port 5454 --nsid-hostname
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.