I have a home network with an internal DNS resolver. I have some subdomains (public) that maps to a real world IP address, and maps to the home server private address when inside home.

In short, i use unbound and have added some local-data entries so that when at home, those subdomains points to 192.168.x.y instead.

All works perfectly fine from Windows and from Linux PCs.

Android, instead, doesnt work.

With dynamic DHCP allocation on android, the names cannot be resolved (ping will fail…) from the android devices. With specific global DNS servers (like dns.adguard.com) of course will always resolve to the public IP.

The only solution i found is to disable DHCP for the Wifi on android and set a static IP with the 192.168.x.y as DNS server, in this case it will work.

But why? Aynbody has any hints?

It’s like Android has some kind of DNS binding protection enabled by default, but i cannot find any information at all.

    • MangoPenguin
      link
      fedilink
      English
      arrow-up
      1
      ·
      3 months ago

      Strange, have you checked the interface info on Android to see what DNS info it’s getting from the DHCP server?

      Also check that it’s getting an IP on the 192.168.x.y network, and not some other subnet if the AP is doing funky things.

      • Shimitar@feddit.itOP
        link
        fedilink
        English
        arrow-up
        1
        ·
        3 months ago

        It’s blatantly ignoring the DNS i set via DHCP it seems. Only if i set it manually (static) it will use it! I have no subnets

        • MangoPenguin
          link
          fedilink
          English
          arrow-up
          1
          ·
          3 months ago

          Does a PC connected to the same wifi network as the phone get the proper DNS servers and work like it should?

          • Shimitar@feddit.itOP
            link
            fedilink
            English
            arrow-up
            1
            ·
            3 months ago

            Yes, perfectly… My guess is android bypass local resolver and goes via DoH l, which sucks hard

            • MangoPenguin
              link
              fedilink
              English
              arrow-up
              1
              ·
              3 months ago

              If you have private DNS turned off it doesn’t, unless maybe you have some manufacturer specific weirdness going on with extra software.

              • Shimitar@feddit.itOP
                link
                fedilink
                English
                arrow-up
                1
                ·
                3 months ago

                Well, my experience is that unless you set static IP+DNS in android WiFi advanced networks, it will not obey the dhcp option 6.

                LineageOS, vanilla with mind the gapps

                • MangoPenguin
                  link
                  fedilink
                  English
                  arrow-up
                  1
                  ·
                  3 months ago

                  Odd, I’ve had a Pixel, Oneplus 7 pro, and now a Galaxy S21 and they all pick up my DNS server from DHCP without any issues.