NodeMCU的域名解析作为接入点

时间:2017-06-19 12:05:39

标签: networking dns wifi nodemcu access-point

我正在阅读enduser setup Module上的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

1 个答案:

答案 0 :(得分:1)

它总是为每个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。

Line 1470:

wifi_get_ip_info(if_index , &ip_info)

Line 1491:

c_memcpy(&(dns_reply[insert_byte]), &(ip_info.ip), 4);