Arduino core for ESP32 Wiki content

Missing DNS settings when using static IP

Use

WiFi.config(IP,GW,SUB,DNS1,DNS2)

instead of

WiFi.config(IP,GW,SUB)

 

A valid DNS will be available only if you started the network connection with default parameters (like Wifi.begin(ssid,sspass)), but will not be available in case you started your network connection with WiFi.config(IP,gateway,subnet) (used to get fix IP) without giving it valid DNS -> WiFi.config(IP,GW,SUB,DNS1,DNS2)!!!