简体   繁体   中英

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

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.

  • 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM