The following works without problem in create a LAN:
PC: Windows 10 mobile hotspot.
Web server is running on windows 10.
Android: Connect android to the hotspot.
http://192.168.137.1/foo.html
How to access the page using a server name such as
http://myserver.com/foo.html
instead of ip address.
I do not like to change /etc/hosts since it is read only. it is not a good idea to change it.
How to use DNS to solve this?
Except editing /etc/hosts you have two options:
Set up DNS server on Windows 10
MaraDns is a free open-source DNS server.
myserver.com->192.168.137.1
8.8.8.8
Set up DNS on your router
If you don't have this ability on your router you might try DD-WRT.
DD-WRT is a Linux based alternative OpenSource firmware suitable for a great variety of WLAN routers and embedded systems.
myserver.com->192.168.137.1
8.8.8.8