Preferred and alternate DNS settings in esp32

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
Posts: 9
Joined: Fri May 03, 2019 10:08 am

Preferred and alternate DNS settings in esp32

Post by akushva » Tue Sep 03, 2019 12:34 pm

Generally we use the command
network.ifconfig ('', '', '', '')

to set the IP address configuration with network.ifconfig, passing a tuple of four values. Now I want to enter a alternate DNS setting into this command .
Is there any way to make provision for entering alternate DNS setting and also preferred DNS setting as generally done in laptops.

Thanks in advance.. :)

User avatar
Posts: 1170
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia

Re: Preferred and alternate DNS settings in esp32

Post by jimmo » Tue Sep 03, 2019 12:56 pm

Setting additional DNS servers is supported by the lower level ESP IDF function `tcpip_adapter_set_dns_info` (and also supported by LWIP used by STM32).

It would be a very straightforward feature to implement -- the tricky part is coming up with what the ifconfig API should look like. Maybe if the fourth entry in the tuple was optionally allowed to be tuple of DNS server addresses?

Post Reply