Skip to content

Fix Android local DNS preferred domain resolution - #4355

Merged
nekohasekai merged 1 commit into
SagerNet:testingfrom
NagaseMinato:fix/android-local-dns-preferred-domain
Aug 5, 2026
Merged

Fix Android local DNS preferred domain resolution#4355
nekohasekai merged 1 commit into
SagerNet:testingfrom
NagaseMinato:fix/android-local-dns-preferred-domain

Conversation

@NagaseMinato

@NagaseMinato NagaseMinato commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix preferred_by: local support for the Android graphical client.

The Android client replaces the regular local DNS transport with a libbox platform transport, but that transport did not implement DNSTransportWithPreferredDomain. As a result, valid configurations failed at startup with DNS server type does not support preferred_by: local.

Changes

  • Add DNSTransportWithPreferredDomain support to the platform transport.
  • Share preferred-domain matching between regular and platform local transports.
  • Resolve hosts-file and neighbor_domain entries before falling back to Android DnsResolver.
  • Keep mDNS and normal platform DNS behavior unchanged.
  • Organize shared preferred-domain and neighbor-resolution logic into separate files.

Tests

Added coverage for:

  • hosts, neighbor_domain, and mDNS matching;
  • hosts and neighbor local responses;
  • platform resolver fallback;
  • invalid neighbor_domain entries;
  • platform transport interface support.

@nekohasekai
nekohasekai force-pushed the testing branch 20 times, most recently from b2dc1fe to 115dbec Compare August 3, 2026 11:22
@nekohasekai
nekohasekai force-pushed the testing branch 2 times, most recently from 8530354 to 62095fa Compare August 4, 2026 14:59
@nekohasekai
nekohasekai force-pushed the fix/android-local-dns-preferred-domain branch from 2447697 to c0c46b8 Compare August 5, 2026 06:18
@nekohasekai
nekohasekai merged commit d1e283b into SagerNet:testing Aug 5, 2026
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.

2 participants