Skip to content

fix(iroh-dns): drop link-local and unspecified system nameservers#4210

Draft
Frando wants to merge 1 commit into
mainfrom
Frando/dns-filter-link-local
Draft

fix(iroh-dns): drop link-local and unspecified system nameservers#4210
Frando wants to merge 1 commit into
mainfrom
Frando/dns-filter-link-local

Conversation

@Frando
Copy link
Copy Markdown
Member

@Frando Frando commented Apr 29, 2026

Description

We have reports of Android handing out link-local nameservers in LinkProperties.getDnsServers() when the device is tethered through an iPhone. Without a scope ID those addresses are not reachable from a connected UDP socket, so every DNS query times out before the public-DNS fallback kicks in.

The system-config reader already filters Windows IPv6 site-local anycast (the deprecated fec0:0:0:ffff::/96 range that Windows still configures alongside the loopback adapter). This PR generalizes that into a single is_usable_nameserver helper and adds three more drops:

  • link-local IPv6 (fe80::/10)
  • link-local IPv4 (169.254.0.0/16)
  • the unspecified addresses (0.0.0.0, ::)

The filter applies on every platform; nothing here is Android-specific. The iPhone-tether case was just the one we noticed.

Breaking Changes

None.

Notes & open questions

Change checklist

  • Self-review.
  • Tests if relevant.
  • All breaking changes documented.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 29, 2026

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/4210/docs/iroh/

Last updated: 2026-04-29T10:40:07Z

## Description

Android tethered through an iPhone publishes link-local nameservers
in `LinkProperties.getDnsServers()`. Without a scope ID those are not
routable from a connected UDP socket and every query times out before
falling back.

Generalize the existing `WINDOWS_BAD_SITE_LOCAL_DNS_SERVERS` filter
into `is_usable_nameserver`, which also drops link-local IPv4
(`169.254.0.0/16`), link-local IPv6 (`fe80::/10`), and the unspecified
addresses. The filter applies on every platform.

## Breaking Changes

None.

## Notes & open questions

This is a reachability filter, not a trust boundary. Authenticated DNS
still requires DNS-over-HTTPS or DNSSEC on top.

## Change checklist
- [x] Self-review.
- [x] Tests if relevant.
- [x] All breaking changes documented.
@Frando Frando force-pushed the Frando/dns-filter-link-local branch from f36b5de to c507c1f Compare April 29, 2026 10:37
@Frando Frando changed the base branch from Frando/android-dns to main April 29, 2026 10:37
@flub
Copy link
Copy Markdown
Contributor

flub commented Apr 29, 2026

Ugh, good catch but I don't think filtering out the link-local DNS servers is generally a good idea. Can we not use them correctly?

@Frando
Copy link
Copy Markdown
Member Author

Frando commented Apr 29, 2026

Ugh, good catch but I don't think filtering out the link-local DNS servers is generally a good idea. Can we not use them correctly?

I don't know. We just have the report of an Android phone being tether to an Iphone failing to resolve DNS. We'd need to try to replicate this I guess.

@n0bot n0bot Bot added this to iroh Apr 29, 2026
@github-project-automation github-project-automation Bot moved this to 🚑 Needs Triage in iroh Apr 29, 2026
@github-actions
Copy link
Copy Markdown

Netsim report & logs for this PR have been generated and is available at: LOGS
This report will remain available for 3 days.

Last updated for commit: 394c464

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

Labels

None yet

Projects

Status: 🚑 Needs Triage

Development

Successfully merging this pull request may close these issues.

2 participants