【问题标题】:Android: mapping hostname to IP on windows 10 using DNS?Android:使用 DNS 将主机名映射到 Windows 10 上的 IP?
【发布时间】:2017-10-30 09:38:50
【问题描述】:

以下在创建局域网时没有问题:

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

如何使用服务器名称访问页面,例如

http://myserver.com/foo.html

而不是IP地址。

我不喜欢更改 /etc/hosts 因为它是只读的。改变它不是一个好主意。

如何使用DNS来解决这个问题?

【问题讨论】:

    标签: android windows dns ip-address server-name


    【解决方案1】:

    除了编辑 /etc/hosts 你有两个选择:

    在 Windows 10 上设置 DNS 服务器

    MaraDns 是一个免费的开源 DNS 服务器。

    • 您需要映射myserver.com->192.168.137.1
    • 所有其他域请求只传递给8.8.8.8
    • 将 windows 10 IP 配置为 android DNS

    在您的路由器上设置 DNS

    如果您的路由器没有此功能,您可以尝试DD-WRT

    DD-WRT 是基于 Linux 的替代开源固件,适用于各种 WLAN 路由器和嵌入式系统。

    • 同样,您需要映射myserver.com->192.168.137.1
    • 所有其他域请求只传递给8.8.8.8
    • 将路由器IP配置为安卓DNS

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-05-07
      • 1970-01-01
      • 1970-01-01
      • 2018-07-21
      • 1970-01-01
      • 2021-10-08
      • 1970-01-01
      相关资源
      最近更新 更多