Repository navigation
deps!: replace hickory with simple-dns and n0-dns-resolver - #93
Merged
Merged
Conversation
Frando
marked this pull request as ready for review
November 23, 2026 13:10
Frando
force-pushed
the
deps/simple-dns
branch
from
November 23, 2026 13:13
936aa13 to
d2de86f
Compare
The lab DNS server only parses queries and writes A, AAAA and TXT answers. `simple-dns` covers this. It is a small crate that only depends on `bitflags`. Names in `simple-dns` compare without ASCII case and ignore the trailing dot, so the store no longer needs `LowerName`. `DnsServer::remove` took a hickory `RecordType`. It now takes a new `patchbay::dns_server::RecordType` with `A`, `Aaaa` and `Txt` variants, so the public API no longer exposes a DNS crate type. `set_txt` now checks each value when the record is set. A value longer than 255 bytes returns an error. New unit tests check `handle_query` for case, response flags, NOERROR and NXDOMAIN. A new lab test reads a TXT record over DNS. - `DnsServer::remove` takes `patchbay::dns_server::RecordType` instead of `hickory_proto::rr::RecordType`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The DNS tests used `hickory-resolver` as a real resolver client inside device namespaces. iroh now resolves with `n0-dns-resolver`, so the tests use it too. This removes the last hickory crate from the workspace. A shared `lookup_first_v4` helper replaces `first_a` and the repeated resolver setup. The tests drop the `hickory_` prefix. One test uses `DnsResolver::system_with_fallback()`, the others read only the system configuration. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Frando
force-pushed
the
deps/simple-dns
branch
from
November 26, 2026 08:20
d2de86f to
bec9ce4
Compare
The `hickory-resolver` dev-dependency turned on the `rt-multi-thread` feature of tokio. `examples/simple.rs` uses `#[tokio::main]` and needs this feature. Without it, builds of `patchbay` alone fail. This includes the CI step `cargo clippy -p patchbay --no-default-features --all-targets` and also `cargo test -p patchbay`. A tokio dev-dependency now turns the feature on. The `dns-server` feature now uses `dep:simple-dns`. Without `dep:`, Cargo adds an implicit public feature named `simple-dns`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`set_txt` gets an `# Errors` section for invalid names and for values longer than 255 bytes. The module docs said that the server truncates responses over 512 bytes. It does not: it sends the full response and never sets the TC flag. The docs also list a new limit. The server drops a query that `simple-dns` cannot parse, for example a query for an unknown record type. The client then times out. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`remove_record_by_type` checks that `remove` deletes only the record of the given type and ignores the case of the name. `txt_value_length_limit` checks that `set_txt` accepts a 255-byte value and rejects a 256-byte value. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The lab DNS server uses
hickory-prototo parse queries and to write A,AAAA and TXT answers. The tests use
hickory-resolveras a client. Bothare large for what we need. iroh now uses
simple-dnsandn0-dns-resolver.Approach
dns_server.rsusessimple-dns. Names insimple-dnscomparewithout ASCII case and ignore the trailing dot. Thus the store keys on
Namedirectly and no longer needsLowerName.DnsServer::removetook a hickoryRecordType. It now takes a newpatchbay::dns_server::RecordType(A,Aaaa,Txt). The publicAPI does not expose a type from the DNS crate.
set_txtchecks each value when you set the record. A value longerthan 255 bytes returns an error.
n0_dns_resolver::DnsResolverin place ofhickory-resolver. A sharedlookup_first_v4helper replaces therepeated resolver setup.
hickory-resolverturned on thert-multi-threadfeature of tokio,and
examples/simple.rsneeds it. A tokio dev-dependency now turns iton, so builds of
patchbayalone still work.Breaking changes
DnsServer::removetakespatchbay::dns_server::RecordTypeinsteadof
hickory_proto::rr::RecordType.Impact
Cargo.lock.simple-dnsdoes notknow, and the client times out. Before, the server answered NOERROR or
NXDOMAIN. The module docs list this limit.
handle_queryfor case, response flags, NOERRORand NXDOMAIN. New lab tests read a TXT record over DNS, and cover
DnsServer::removeand the TXT length limit.🤖 Generated with Claude Code