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?
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:52host laptop 192.168.43.1
returns the IP of the laptop (192.168.43.44). The log of the phone app (DAVx5) begins withjava.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:41adb shell
on the laptop: I have neithernslookup
norhost
commands, butping 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