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.

  • CondorWonder@lemmy.ca
    link
    fedilink
    English
    arrow-up
    6
    ·
    21 days ago

    The phone or browser may be using DNS over HTTP (aka DoH), check if you can disable it for the wifi network. You may have to disable it on the phone or browser to get your desired behaviour - look up directions for your browser.

  • MangoPenguin@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    5
    ·
    edit-2
    21 days ago

    Do you have private DNS enabled on Android? That would use a public DNS server by default regardless of what DHCP configures.

    Also check your browsers, some have their own DNS settings.

    • ShimitarOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      21 days ago

      Private DNS is disabled.

      And even ping from tmux fails…

      • MangoPenguin@lemmy.blahaj.zone
        link
        fedilink
        English
        arrow-up
        3
        ·
        21 days 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.

        • ShimitarOP
          link
          fedilink
          English
          arrow-up
          2
          ·
          21 days 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

            • ShimitarOP
              link
              fedilink
              English
              arrow-up
              1
              ·
              20 days ago

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

              • MangoPenguin@lemmy.blahaj.zone
                link
                fedilink
                English
                arrow-up
                1
                ·
                20 days ago

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

                • ShimitarOP
                  link
                  fedilink
                  English
                  arrow-up
                  1
                  ·
                  19 days 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

  • theit8514@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    21 days ago

    You mentioned ping. If you’re using Termux you may need to manually update its DNS settings (different from the system DNS). The file is /data/data/com.termux/files/usr/etc/resolv.conf

    To make it roam you probably want your home dns first then some internet resolvers after that.

    • ShimitarOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      21 days ago

      Thanks! This explains a few things… But not why Android is IGNORING my DNS pushed via DHCP even if private DNS is disabled…

  • Decronym@lemmy.decronym.xyzB
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    19 days ago

    Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I’ve seen in this thread:

    Fewer Letters More Letters
    AP WiFi Access Point
    DHCP Dynamic Host Configuration Protocol, automates assignment of IPs when connecting to a network
    DNS Domain Name Service/System
    HTTP Hypertext Transfer Protocol, the Web
    IP Internet Protocol

    5 acronyms in this thread; the most compressed thread commented on today has 11 acronyms.

    [Thread #933 for this sub, first seen 23rd Aug 2024, 06:15] [FAQ] [Full list] [Contact] [Source code]