3

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?

1 Answers1

1

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:

Irfan Latif
  • 20,353
  • 3
  • 70
  • 213