0

From my tablet running Android 9 I would like to access a web site on my local server using its hostname (server). This works fine from my laptop computer running Debian 10. However, on my tablet I get the error message "This site can't be reached" when I enter the address http://server.local in a web browser. Any clues?

  • What is your intended DNS resolver in this case? Does your computer know how to resolve on its own? Do you expect the phone to know it or to query it? – wbogacz Feb 1 at 16:41
  • @wbogacz The server and my laptop runs Avahi. Can I install Avahi on Android or should I install something else? – August Karlstrom Feb 1 at 16:57
  • Does this answer your question? How to ping a local network host by hostname? – Irfan Latif Feb 1 at 20:01
  • @IrfanLatif If I login on my router (192.168.0.1) I can see that my server correctly presents itself with the name server. The question is, what should I do on my Android device to make it aware of the local hostnames? – August Karlstrom Feb 2 at 19:05
0

Duplicate of: How to ping a local network host by hostname?

I order to access a local computer from Android using hostname. You have two options:

  1. Add the IP address vs. hostname mapping of the local computer to /system/etc/hosts file on your Android device. See How to edit 'etc/hosts' file? and How to edit '/etc/hosts' file on non-rooted phone?

OR

  1. Run a DNS server on local network. Usually a WiFi router is already hosting a DHCP+DNS server.
    • Make sure that DNS server is aware of the hostname of the local computer e.g. communicated through DHCP or some other mechanism.
    • Make sure that DNS queries from Android device goes to local DNS server and not on internet. See How to configure DNS properly?
      • Turn Private DNS off on Android 9+, and
      • Add static DHCP/DNS from settings, or
      • Add DNS using ndc resolver setnetdns command-line, or
      • Use VPN based app mentioned above to force DNS server, or
      • On rooted phone use iptables DNAT for port 53 to force DNS server

RELATED:

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.