Search code examples
androiddnsadbesp32mdns

Android doesn't resolve mDNS address in local network, but does so in another


Background

In my home network, accessing http://esp32.local (ESP32S3 dev board running mDNS) from my Android phone using any browser results in errors such as ERR_NAME_NOT_RESOLVED or DNS_PROBE_FINISHED_NXDOMAIN. Tried Termux, same thing. Connected via adb and pinger from there, same thing.

Other devices on the same network, including a Windows laptop, an iPhone 6S (or similar) and an older MacBook Air. Each successfully resolves esp32.local.

In another local network (mother-in-law), everything just works (previously I recall things worked even in my own local network, but I'm not sure anymore, it's a mirage).

What I've tried

Disabled private DNS on my phone, no effect (In my mother-in-law's network mDNS resolving worked only when this setting was off.) Reverted back to my ISP's DNS servers, no effect. Using adb I verified (using dumpsys connectivity's output) that private DNS were off and also that my IPS's DNS servers were active. Turned off IPv6 on my local network (since my mother-in-law's didn't have this enabled), no effect. Tried rebooting everything, phone, network, no effect.

The difference?

I have a TP-Link Deco M4, the other router is TP-Link Archer AX10 AX1500, nothing fancy about them. Mine is running as a router, configured "behind" my ISP's ONT device using PPPoE passthrough, the other is an AP I believe, maybe a router (but it's totally default aside from this).

Ideas?

Any ideas how to solve this problem? Where to look? What can be the source of the problem?

I have seen similar problems online being reported here and there but they lack information, clarity as to define whether those are about the same problem or something else.


Solution

  • I think your mother-in-law network runs a DNS server on the router which does the resolving for you. So it's DNS, not mDNS. This is confirmed by failure to resolve the hostname when your phone uses private DNS. Your router, on another hand, doesn't resolve . local domain as belonging to local network.

    When the devices obtain the IP address via DHCP from the router, the latter can specify the DNS servers to use. Yours may specify the provider's servers while mother-in-law's specifies its own.