1

I and probably others know, if turning on the mobile hotspot and enable wifi-tethering, we are able to use our android phone to get internet access via a notebook (and other devices of course) connected to this android hotspot over WiFi.

Our phone also then acts as a router, since tethering spans a private network, I usually know it as 192.168.43.xxx to forward requests from the notebook to the outside world, the internet which is enabled by receiving a public IP from the service provider.

What I am looking for, is a DNS service running on this tethering phone on the private side of the network. I'd like to reach my devices via hostnames on the little private LAN provided by the tethering phone.

I know there are lots of options and public discussions to tune DNS settings on the public side of the hotspot (8.8.8.8, 1.1.1.1 and things like that). Since A9 there is even a private DNS option. But all this stuff is not what I am looking for.

So to configure my question: How can I enable a DNS service on the private side of my tethering hotspot on an Android 10 (Lineage 17.1) device?

woodz
  • 111
  • 1
  • 1
  • 3
  • Up to Android 9 dnsmasq runs on Android device as DNS server when you turn on hotspot or USB tethering. dnsmasq can be configured to achieve what you are looking for. Some relevant details here: How to ping a local network host by hostname? – Irfan Latif Jul 02 '20 at 17:52
  • @IrfanLatif: Thank you for all your heavily detailed research work! I should have mentioned that I am using A10 on the hotspot phone, I'll edit – woodz Jul 03 '20 at 12:49
  • @IrfanLatif Hi, I have the same question as woodz. But I am on Android 8.1 . I read your link. When my phone and my laptop are on my local Wifi network (DSL router), my phone can find my laptop by its hostname. But when my laptop connects to my phone used as access point (Wifi tethering), my phone cannot find my laptop by its hostname. Do you have advice? Should I post a new question? (What I mean by "find": the laptop runs a Radicale server on port 5232, the phone has the DAVx5 app which can connect to http://laptop:5232 in the first situation but not the second.) – L. Levrel Nov 03 '20 at 17:22
  • @L.Levrel sorry it's not possible for me to answer your query wothout performing some troubleshooting steps. – Irfan Latif Nov 03 '20 at 18:18
  • @IrfanLatif thank you for answering. Do you mean you cannot help me, or you may help me if I do additional tests? – L. Levrel Nov 04 '20 at 10:20
  • @L.Levrel I can't help with troubleshooting steps. You can follow any DNS troubleshooting guide. Android-specfic things are explained in my previous answers on the subject. You can ask me something not already explained. – Irfan Latif Nov 04 '20 at 11:05
  • @IrfanLatif I think I already checked all that I could think of. (i) The laptop (Linux) does send its hostname over DHCP, because when using the Wifi router the phone accesses the laptop by hostname; the settings of the laptop are the same for connecting to the Wifi router or to the phone access point. (ii) The name resolving works fine on the phone, at least when it is connected to the Wifi router. So, if I understood your other answers correctly, the problem lies in dnsmasq on the phone, but how do I debug this? I have adb on the laptop but the phone is not rooted. Thanks! – L. Levrel Nov 04 '20 at 17:52
  • More info. From the laptop the phone DNS seems OK: host laptop 192.168.43.1 returns the IP of the laptop (192.168.43.44). The log of the phone app (DAVx5) begins with java.net.UnknownHostException: Unable to resolve host "laptop": No address associated with hostname at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:111) ... – L. Levrel Nov 04 '20 at 20:41
  • I ran adb shell on the laptop: I have neither nslookup nor host commands, but ping laptop answers "unknown host". So it looks like the phone cannot use its own DNS which works perfectly for the access point clients... – L. Levrel Nov 06 '20 at 18:14

0 Answers0