Android: mapping hostname to IP on windows 10 using DNS?

1.3k Views Asked by At

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?

1

There are 1 best solutions below

0
On

Except editing /etc/hosts you have two options:

Set up DNS server on Windows 10

MaraDns is a free open-source DNS server.

  • You will need to map myserver.com->192.168.137.1
  • All the other domain requests just pass to 8.8.8.8
  • Configure the windows 10 IP as the android DNS

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.

  • Again, you will need to map myserver.com->192.168.137.1
  • All the other domain requests just pass to 8.8.8.8
  • Configure the router IP as the android DNS