Skip to content

deps!: replace hickory with simple-dns and n0-dns-resolver - #93

Open
Frando wants to merge 2 commits into
mainfrom
deps/simple-dns
Open

Frando wants to merge 2 commits into
mainfrom
deps/simple-dns

Conversation

@Frando

@Frando Frando commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Stacked on #92.

Problem

The lab DNS server uses hickory-proto to parse queries and to write A,
AAAA and TXT answers. The tests use hickory-resolver as a client. Both
are large for what we need. iroh now uses simple-dns and
n0-dns-resolver.

Approach

  • dns_server.rs uses simple-dns. Names in simple-dns compare
    without ASCII case and ignore the trailing dot. Thus the store keys on
    Name directly and no longer needs LowerName.
  • DnsServer::remove took a hickory RecordType. It now takes a new
    patchbay::dns_server::RecordType (A, Aaaa, Txt). The public
    API does not expose a type from the DNS crate.
  • set_txt checks each value when you set the record. A value longer
    than 255 bytes returns an error.
  • The DNS tests use n0_dns_resolver::DnsResolver in place of
    hickory-resolver. A shared lookup_first_v4 helper replaces the
    repeated resolver setup.

Breaking changes

  • DnsServer::remove takes patchbay::dns_server::RecordType instead
    of hickory_proto::rr::RecordType.

Impact

  • No hickory crate remains in Cargo.lock.
  • New unit tests check handle_query for case, response flags, NOERROR
    and NXDOMAIN. A new lab test reads a TXT record over DNS.

@Frando
Frando marked this pull request as ready for review November 23, 2026 13:10
Frando and others added 2 commits November 23, 2026 14:13
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
@Frando
Frando changed the base branch from deps/futures-lite to main November 23, 2026 13:13

This branch has not been deployed

No deployments
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.

1 participant