Code: Select all
Change IP configuration settings disabling the dhcp client
Code: Select all
Change IP configuration settings disabling the dhcp client
Using the native API, is it possible to set the DNS manually after the DHCP assigns it automatically? In other words to manually override the DNS setting set by the DHCP server?
Oh, ok, ok, I kinda get it now. If you could provide aditional help it would be greatly appreciated, but I get your idea I will give it a try.
Oh my God! You actually tried, thank you so much for your help. I also tried and couldnt set de DNS manually by any mean. I really, really apreciate your help.gtjoseph wrote: ↑Mon Sep 05, 2022 10:41 amWell, I gave it my best shot but there just doesn't seem to be a way to use the DHCP client but set the DNS server manually. The esp_netif_dhcpc_option() API is hard coded to allow only two options (ESP_NETIF_VENDOR_SPECIFIC_INFO and ESP_NETIF_IP_REQUEST_RETRY_TIME) and will return ESP_ERR_ESP_NETIF_INVALID_PARAMS if you try to give it any other parameter and that's not documented anywhere. I'm not sure if this is a bug in the code or the documentation.
LWIP itself does allow you to use your own local dynamic lookup function but it doesn't seem to be exposed through esp_netif so it's probably take a bit of effort to get it to work.
The only other thing I can suggest is that if you have control over the dhcp server in your runtime environment, you could add an option specific to the ESP32 to give it a different dns server than other dhcp clients would get.
Users browsing this forum: Bing [Bot] and 104 guests