1

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 at http://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 command ping 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.)

3
0

This answer could be written thanks to Irfan Latif's comments.

  • Is this a bug or a "feature"? It's expected behavior (see details in the first comment).

  • Can it be corrected without rooting the phone? Yes. I installed Virtual Hosts, created a one-line file containing 192.168.43.44 laptop and pointed the app to it. The app is really easy to turn on/off, so I can use it only when needed.

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.