Summary
I use my phone (Android 8.1) as access point. The qualified name of clients is resolved for other clients, but not for the phone itself.
Details
My laptop (Linux Mint 19) is set up to connect to WiFi networks using DHCP. When it does, it registers its qualified name laptop
in the DNS of the access point. This is verified in several circumstances (e.g., when the laptop and other devices are connected to the WiFi network of my home DSL box, they can ping the laptop using its name).
When the laptop is connected to the phone access point, its qualified name seems to be registered as well. I test this by running host laptop 192.168.43.1
on the laptop itself, where 192.168.43.1
is the IP of the phone in the access point network. The command returns 192.168.43.44
which is the IP of the laptop (it is shown in the connection informations on the laptop).
However, apps and commands run on the phone cannot use the qualified name. Two tests:
- the DAVx⁵ app cannot reach Radicale running on the laptop at
http://laptop:5232/
(whereas it can athttp://192.168.43.44:5232/
). the log says:
java.net.UnknownHostException: Unable to resolve host "laptop": No address associated with hostname
at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:111)
<snip>
- under
adb shell
(phone connected in debug mode via usb), the commandping laptop
returns an "unknown host" error.
Questions
Is this a bug or a "feature"? Can it be corrected without rooting the phone? (I need DAVx⁵ to be able to connect to Radicale with the same URL whatever the WiFi network used by the phone and the laptop, hence the need to use a qualified name that will be resolved to the laptop IP in any circumstance.)
hosts
file). Details in How does Android OS do DNS name resolution? and How to ping a local network host by hostnamehosts
file? Is it possible without rooting the phone?