8000 DHCP custom option by mcspr · Pull Request #8582 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content
Merged
Prev Previous commit
Next Next commit
fix dns setter
  • Loading branch information
mcspr committed May 31, 2022
commit 1010b860793ca39438fa8c799adc4bee1a7fe1b8
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ void setup() {
}
Serial.printf("\nSTA: %s (dns: %s / %s)\n", WiFi.localIP().toString().c_str(), WiFi.dnsIP(0).toString().c_str(), WiFi.dnsIP(1).toString().c_str());

// give DNS servers to AP side
dhcpSoftAP.dhcps_set_dns(0, WiFi.dnsIP(0));
dhcpSoftAP.dhcps_set_dns(1, WiFi.dnsIP(1));
// by default, DNS option will point to the interface IP
// instead, point it to the real DNS server
// (notice that only a single IP is supported)
dhcpSoftAP.setDns(WiFi.dnsIP(0));

WiFi.softAPConfig( // enable AP, with android-compatible google domain
IPAddress(172, 217, 28, 254), IPAddress(172, 217, 28, 254), IPAddress(255, 255, 255, 0));
Expand Down
0