networking - NodeMCU作为接入点的域名解析

标签 networking dns wifi nodemcu access-point

我正在阅读有关最终用户设置模块的 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。

Line 1470:

wifi_get_ip_info(if_index , &ip_info)

Line 1491:

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

关于networking - NodeMCU作为接入点的域名解析,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44630131/

相关文章:

python - 在python中模拟慢速网络的简单方法

c - 了解 c 中的多线程服务器/客户端程序

Firebase 托管不更新连接的域

Android 奇怪的跨设备行为

iphone - 检测wifi是否开启 - iOS

Linux : I programatically changed my default route to eth0 but now I can't ping, 有什么建议吗?

android - 如何在 robospice 中安装改造扩展

Python - 域名的正则表达式

dns - 自动子域名注册

android - 通过wifi从android访问localhost