我正在阅读有关最终用户设置模块
的 NodeMCU 文档,现在我对以下声明有点困惑:
Connect to that SSID and then navigate to the root of any website (e.g., http://example.com/...
A web page will load, allowing the end user to provide their Wi-Fi information.
在默认配置下,NodeMCU 接入点的 IP 地址为:192.168.4.1。
我的问题是,如何解析 www.example.com
使其指向模块的接入点 IP 地址(192.168.4.1)
?模块有默认的 DNS 配置吗?
提供完整文档 here .
最佳答案
它总是为每个 DNS 查询返回 ESP 的 IP。
You can see that in line 1491 of the source code. (enduser_setup.c)
enduser_setup_dns_recv_callback将始终返回通过调用 wifi_get_ip_info
检索的 IP。
wifi_get_ip_info(if_index , &ip_info)
c_memcpy(&(dns_reply[insert_byte]), &(ip_info.ip), 4);
关于networking - NodeMCU作为接入点的域名解析,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44630131/