Closed will-emmerson closed 3 years ago
Hi, by default the DHCP server on the ESP32 offers the IP address of the AP Interface (192.168.4.1) as DNS-Server address. If a device wants to reach for example the url www.example.com it sends a request to the DNS-Server, which in this case should be at 192.168.4.1. The problem is that there is no DNS-Server running on the ESP32. In this example this problem is solved by setting the DNS-Server address that the ESP32 DHCP-Server offers to the IP address of the Public-DNS-Server from Google (8.8.8.8).
If you don't need a custom DNS-Server to resolve domain names the code above is not needed. In most examples you only communicate in the ESP32-AP-Network and probably by using the IP address of the device you want to reach so that this is not necessary.
I hope this answers your questions, feel free to ask if you have any further questions. :)
I am closing this issue due to inactivity. Please reopen the issue if it still exists.
Sorry to ask a stupid networking question which is probably not really specific to this project, but why are the following lines needed?
These aren't necessary in the Espressif Wifi AP example, but obviously they are here otherwise it doesn't work. Is it because DHCP is only enabled for the default connection (in this case wifi STA) normally?