fix(dns_dev): emit one addr= TXT entry per address#152
Merged
zachsmith1 merged 1 commit intomainfrom May 1, 2026
Merged
Conversation
iroh's DNS parser at iroh-relay/src/endpoint_info.rs runs
SocketAddr::from_str on each IrohAttr::Addr value as-is — it does
not split on whitespace. SocketAddr::from_str("A B C") fails, and
.ok() drops the entry silently. The dev DNS server was emitting one
"addr=A B C" line, which iroh would parse to zero direct addresses
and only see relay=.
iroh's own serializer (iroh-relay/src/endpoint_info.rs:511-520) pushes
one (Addr, addr.to_string()) attribute per IP, so the canonical wire
form is multiple "addr=<single-sockaddr>" TXT entries. Match that
shape here so endpoints registered via this dev server actually
resolve their direct addresses when iroh dials them.
scotwells
approved these changes
May 1, 2026
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.
Summary
The dev DNS responder in `cli/src/dns_dev.rs` was joining all direct addresses into a single `addr=A B C` TXT line. iroh's parser does not split on whitespace — it runs `SocketAddr::from_str` on each `IrohAttr::Addr` value as-is and silently drops failures. So endpoints served via this dev DNS would parse to zero direct addresses on the dialer side; only the `relay=` entry survived.
iroh's serializer at `iroh-relay/src/endpoint_info.rs:511-520`:
…pushes one `(Addr, ...)` attribute per IP. The canonical wire form is multiple `addr=` TXT entries.
Change
Replace the join with a loop emitting one `addr=${addr}` TXT entry per address. Same approach as the corresponding fix in `network-services-operator` (datum-cloud/network-services-operator#147), discovered when staging iroh-gateway logs showed an `EndpointInfo` with only `Relay(...)` despite the DNS containing `addr=` records.