julian-klode / dns66

DNS-based Host Blocker (and lightweight ad blocker) for Android
https://jak-linux.org/projects/dns66/
GNU General Public License v3.0
2.11k stars 200 forks source link

Retain DNS Search domains from network when DNS66 is active #453

Open warthog9 opened 3 years ago

warthog9 commented 3 years ago

As mentioned on XDA it looks like when the VPN comes up it doesn't retain the DNS search domains from the configured interface, meaning on the 'local' network you can't do (example) http://hostname/ you would have to do http://hostname.fullyqualifieddomain.name. In an ideal world retaining the networks search domains would be nice, and make certain 'local' access a lot easier.

Two ways occur to me to do it, no idea if they are entirely feasible 1) Read the search domains out of the existing dns infrastructure, stash them, bring up the VPN and then add the search domains back in after the fact. This is obviously predicated on being able to actually read them 2) Slightly messier way would be to detect what network you are associated to, and be able to define a list of search domains to inject for that network.

It was noted on XDA It seems we'd have to gather those domains and call addSearchDomain(String domain) for each when building the VPNService. as well, just wanted to make sure that was captured here as well.