Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <DNSServer.h>

const byte DNS_PORT = 53;
IPAddress apIP(192, 168, 1, 1);
IPAddress apIP(8,8,4,4); // The default android DNS
DNSServer dnsServer;
WiFiServer server(80);

Expand All @@ -12,11 +12,9 @@ String responseHTML = ""
"be redirected here.</p></body></html>";

void setup() {
WiFi.disconnect(); //added to start with the wifi off, avoid crashing
WiFi.mode(WIFI_OFF); //added to start with the wifi off, avoid crashing
WiFi.mode(WIFI_AP);
WiFi.softAP("ESP32-DNSServer");
WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0));
WiFi.softAP("DNSServer CaptivePortal example");

// if DNSServer is started with "*" for domain name, it will reply with
// provided IP to all DNS request
Expand Down