diff --git a/components/tcpip_adapter/tcpip_adapter_lwip.c b/components/tcpip_adapter/tcpip_adapter_lwip.c index 7fb221f3a4..726434b5fa 100644 --- a/components/tcpip_adapter/tcpip_adapter_lwip.c +++ b/components/tcpip_adapter/tcpip_adapter_lwip.c @@ -25,6 +25,9 @@ #include "lwip/ip_addr.h" #include "lwip/ip6_addr.h" #include "lwip/nd6.h" +#if LWIP_DNS /* don't build if not configured for use in lwipopts.h */ +#include "lwip/dns.h" +#endif #include "netif/wlanif.h" #include "netif/ethernetif.h" @@ -229,6 +232,12 @@ esp_err_t tcpip_adapter_set_ip_info(tcpip_adapter_if_t tcpip_if, tcpip_adapter_i if (status != TCPIP_ADAPTER_DHCP_STOPPED) { return ESP_ERR_TCPIP_ADAPTER_DHCP_NOT_STOPPED; } +#if LWIP_DNS /* don't build if not configured for use in lwipopts.h */ + u8_t numdns = 0; + for (numdns = 0; numdns < DNS_MAX_SERVERS; numdns ++) { + dns_setserver(numdns, NULL); + } +#endif } ip4_addr_copy(esp_ip[tcpip_if].ip, ip_info->ip);