Skip to content

Remove temporary scoped IPv6 DNS compatibility shim after upstream resolver support #368

Description

@momics

Summary

PR #367 carries a temporary, private scoped-IPv6 DNS compatibility shim so mobile endpoints can use link-local nameservers such as fe80::1%17 without blocking the DNS-SD release.

This issue tracks deleting that shim as soon as the upstream resolver stack can preserve and use an IPv6 destination scope ID. The shim is not intended to become a permanent iroh-http DNS implementation.

Why the shim exists

Mobile network adapters can supply an explicit scoped SocketAddrV6, but the iroh-dns version used by this repository currently passes only addr.ip() into Hickory. Hickory 0.26.1 represents a nameserver destination as IpAddr, so the required scope_id is lost and the link-local server becomes unroutable.

Pinned implementation: https://github.com/n0-computer/iroh/blob/v1.0.2/iroh-dns/src/dns.rs#L745-L750

The PR therefore routes only scoped IPv6 nameservers through a bounded loopback UDP forwarder. The forwarder sends to the original full SocketAddrV6, retaining the interface scope. Ordinary IPv4 and globally routable IPv6 nameservers still go directly through iroh-dns.

This is normal DNS resolver compatibility, not DNS-SD/mDNS implementation. DNS-SD remains in iroh-http-discovery; native Android/iOS adapters remain responsible only for extracting active-network facts.

Upstream tracking

Relevant resolver sources:

The explicit nameserver transport appears capable of preserving a full scoped address. The Android system reader still reconstructs an address from raw InetAddress bytes, so our native adapter may need to keep supplying explicit scope information even after the transport is fixed.

Closing an upstream PR is not sufficient by itself. We need a released dependency and physical-device proof for our adapter path.

Ownership and containment

Per ADR-013, the ecosystem resolver should own DNS transport. Until it does:

  • Keep the shim private and isolated in one compatibility module.
  • Keep endpoint/bind.rs limited to configuring the resolver through that module.
  • Keep DNS-specific shutdown details out of endpoint lifecycle orchestration.
  • Do not expose the shim as a feature or supported public interface.
  • Link this issue from the compatibility module so its removal condition is visible in code review.

Exit criteria

  • A released iroh / iroh-dns dependency preserves a non-zero SocketAddrV6::scope_id() from configuration through UDP transport.
  • Upstream has a transport-level regression that performs a query through a non-zero destination scope, rather than testing only parsing or stored configuration.
  • The supported Android path retains the active network/interface scope, either through upstream system configuration or our thin native fact-extraction adapter.
  • The supported iOS path retains the required interface scope where the platform supplies a link-local nameserver.
  • Add a surviving integration-boundary test outside the compatibility module that performs a real query by passing a scoped SocketAddrV6 directly through released iroh-dns.
  • That integration regression passes against the upstream implementation without the loopback forwarder.
  • Physical-device test: Android resolves through a scoped link-local nameserver while tethered to iPhone.
  • Physical-device test: iOS and Android still complete relay, pkarr, DNS discovery, and DNS-SD cross-platform scenarios after removing the shim.
  • Desktop regression test passes with IPv4, global IPv6, and scoped link-local resolver configurations where available.
  • Remove the compatibility module, retained runtime guard, compatibility-only shutdown wiring, and obsolete proxy tests.
  • Update comments/docs so they no longer describe the upstream limitation.

Physical-device validation matrix

Run after disabling/removing the compatibility forwarder:

Device Network/scenario Required result
Android iPhone Personal Hotspot exposing scoped fe80::/10 DNS Endpoint construction and ordinary hostname resolution succeed
Android Normal dual-stack Wi-Fi No DNS or endpoint regression
Android Transition between Wi-Fi and hotspot Current resolver state is used; no stale task or nameserver
Android + iOS + macOS Same physical LAN All six DNS-SD discovery directions below succeed
  • Android discovers iOS.
  • iOS discovers Android.
  • Android discovers desktop.
  • Desktop discovers Android.
  • iOS discovers desktop.
  • Desktop discovers iOS.
  • Generic custom HTTP DNS-SD service discovery succeeds in both mobile directions.

Expected deletion surface

Once the exit criteria are met, the removal should be deliberately small:

  1. Delete the private scoped_dns_compat module.
  2. Remove its private guard from endpoint transport state.
  3. Update the stable dns_nameservers module to pass its validated full SocketAddr directly to iroh-dns.
  4. Remove proxy-specific tests while retaining stable nameserver parsing/configuration, an integration-boundary resolver regression, and physical-device coverage.

Relationship to PR #367

PR #367 should not be blocked on upstream resolver work: reliable mobile DNS is required for the release and the workaround is bounded, tested, and private. PR #367 must, however, leave the implementation isolated and directly linked to this issue so it cannot silently become permanent infrastructure.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium priorityarchitectureconnectivityPeer discovery and connectiondependenciesPull requests that update a dependency filerustPull requests that update rust code

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions