rethink-app: v055: can't resolve `.local` domains - never get any DNS response
Possibly a followup to the discussions about mDNS in #26:
After updating Rethink to v055[^fd], I can no longer resolve domains in the .local
TLD. Other, more ‘normal’, domains work fine. Previously, even though Rethink couldn’t resolve .local
s through mDNS (and Android wouldn’t do mDNS itself since it thought it was on a VPN), it would at least pass them on via normal DNS to personalDNSFilter[^pdnsftest], where I could manually enter addresses for them and update them when needed.
If I run dig some-machine.local
under Termux, it sits there for about 18 seconds, then tells me connection timed out; no servers could be reached
. Neither Rethink nor pDNSf shows that domain being requested in their logs. Wireshark (running on the machine I’m asking for) never sees the query. The Rethink packet capture does show the query being sent a few times (to 8.8.8.8 and 8.8.4.4), but no response.
(To be clear, it fails under normal Android apps too, not just Termux/Linux commands. I’m just using dig
to see how it’s failing.)
If I talk directly to pDNSf by doing dig @127.0.0.1 -p5300 some-machine.local
, I can still get the address I’ve manually set there.
I’ve tried various combinations of:
- Turning off “DNS booster”
- Turning on “Do not route Private IPs”
- Pressing the DNS refresh button
[^fd]: The F-Droid version, if it matters. [^pdnsftest]: Specifically, the test build from IngoZenz/personaldnsfilter#264 (comment), so that it doesn’t kill Rethink during startup.
About this issue
- Original URL
- State: closed
- Created 10 months ago
- Reactions: 1
- Comments: 19
Commits related to this issue
- mdns: process answers async — committed to celzero/firestack by ignoramous 10 months ago
- mdns: read-from to get remote addr on udp ingress — committed to celzero/firestack by ignoramous 10 months ago
- mdns: m net.IP in dns-sd answer instead of a ptr to it — committed to celzero/firestack by ignoramous 10 months ago
- mdns: prelim support for multi mdns answers — committed to celzero/firestack by ignoramous 10 months ago
- netstack, mdns: missing vars — committed to celzero/firestack by ignoramous 10 months ago
- mdns: quit an infinite for-select with timeouts — committed to celzero/firestack by ignoramous 10 months ago
- mdns: quit an infinite for-select with timeouts — committed to celzero/firestack by ignoramous 10 months ago
- mdns: quit an infinite for-select with timeouts — committed to celzero/firestack by ignoramous 10 months ago
- mdns: never send empty embedded err — committed to celzero/firestack by ignoramous 10 months ago
- mdns: fix nil ptr — committed to celzero/firestack by ignoramous 10 months ago
- mdns: simplify client close — committed to celzero/firestack by ignoramous 9 months ago
- dnsx/transport: Local overrides other transports if present — committed to celzero/firestack by ignoramous 9 months ago
- dnsutil: for mdns domains .local must be final suffix — committed to celzero/firestack by ignoramous 9 months ago
Thank you for doing our design, research, and testing for us! We merely implemented it (erroneously so, for over 4+ versions).
mDNS aside, I doubt p2p apps would still work, unless Do not route Private IPs is enabled or those apps are Excluded from Rethink altogether.
Seems like some Android limitation (ex: #1356), but I’m yet to fully get to the bottom of it.
(closing this issue, feel free to reopen)
@ignoramous Sorry for the delay. Apparently I wasn’t getting update notifications from F-Droid for some reason[^bg] - I just discovered last night that the new version of Rethink (among other things) had shown up.
I just set Termux and AVNC back to the normal ‘allow’ settings, and I can resolve
.local
domains inside both of them - even after removing the manual.local
entries from pDNSf, restarting pDNSf, and pressing the DNS Refresh button in Rethink. (I also tried another.local
that had never been in pDNSf, just to be extra sure.) So far, it all seems to be working properly!Thank you so much for your help with this.
[^bg]: I probably just missed turning off one of the battery optimization settings or something like that, and the OS killed the F-Droid app.
@ignoramous I’ll keep an eye out for it. Thanks.
Hi @Rhys-T: Can you please check if
v055e
(F-Droid should have the build in 3 days or so) works for.local
queries? I tried to set something up on my local network and avahi on my laptop responding toxyz.local
, but could never get it to work; as in, either Rethink doesn’t yet impl mDNS as it should (very likely) or my setup is whack (also equally likely).Yeah, no difference whether rethink is ON or OFF. I think my mdns setup isn’t fully working… I’ll keep looking for ways to test this over the next few days, though.
Good catch. Even though it is unlikely to be the issue here, I’ve fixed it anyway: https://github.com/celzero/firestack/commit/f7190cb424e0fb73fa953e72c949a3c8567452af
And added a bunch more logs(https://github.com/celzero/firestack/commit/3796d92eb41c5fb6e6de9d86bf04466fc6d2e563, https://github.com/celzero/firestack/commit/2674ed6479ed4c7f5b13dd6be3d68f8966ed0e77). I’ll keep this thread updated as I work my way to running tests with mdns myself. I’ve bothered you enough.
Please wait for F Droid to get the update. Backup and restore is a hairy beast.
I think this was some sort of bug in the Go runtime. A
nil
pointer didn’t cause a panic but instead the client was being mopped up… who knows.We’ve fixed the
nil
pointer now; and expect client to NOT close right away and wait for responses. It is another thing if the client works at all: https://github.com/celzero/firestack/commit/190524888d8f64c12bd112bc697943d7df88690bI’ve also tried changing the IP version between IPv4, IPv6, and auto - that didn’t seem to affect it either.
Fair enough. I suspect non-mDNS usage of
.local
is probably getting rarer these days.Oh, I wasn’t saying it was a difficult language - I just haven’t taken the time to learn it yet.
Gotcha. I didn’t know whether ‘upstream’ DNS/mDNS queries and responses would show up in the packet capture or not.
I’m not familiar enough with the app’s architecture to know what the logs should look like, but in hindsight, it makes sense that
closing client
shouldn’t be happening immediately. Not sure what would be causing that, though.Okay. Just wanted to check in case it would help with tracking this down.
🤦 Yeah, I meant ‘exclude’. Not sure what happened there - I think I was testing the ‘bypass’ options as well, just to be on the safe side (they didn’t affect anything), then got mixed up and wrote the wrong one down. Sorry about that.
Thank you for looking into this. Let me know if there’s anything else I can do to help track this down.
Possible but it adds yet another knob in our app and yet another
if
condition in the code… I’d only want to add it if it helps despite Rethink getting mDNS to work (in some happy future).Gotcha. That’s how I’d expect Do not route Private IPs to work… So, no surprises here.
Hm. For me, Go was one of the easiest languages to learn. Fastest I got proficient in. It is a mix of limited versions of both JS + Python.
Yep. This means, the
mdns
transport we’ve wired in isn’t sending out the queries at all. And this would be right as I see themdns
transport is in fact not doing anything, neither does it error out, but closes immediately within a millisecond (instead of waiting for 3 seconds). This is what appears in the logs asNot yet. Good call though. We should include this in the release builds, too.
You mean
exclude
? Yeah, that should let Android’s built-in mDNS support kick-in for just the excluded app.I think there’s some stupid bug in our code. I already spent an hour today without making any progress. I intend to spend some more time tomorrow. Let’s see.
Yep, that “error” doesn’t matter, but I’ve fixed it, anyway.