I rarely create a post, but this time I would like to hear your valued insights.
Background: my ISP gives me 3 DNS addresses, they get stored in the router. My FreeRTOS devices get their DNS addresses from the router, using DHCP. That always worked nice, until today.
Today the first DNS server does not respond. Now I know why it gives me more than one address. The second and third servers work well. But FreeRTOS+TCP doesn’t yet use them though.
Now I want to make sure that up to N DNS-addresses will be stored and used, maybe like this:
BaseType_t xDNSIndex = 0;
uint32_t ulDNSAddresses[ N ];
My question is, how do I determine which DNS to use, i.e. xDNSIndex
? Just let it turn around from 0 to N-1? Or change xDNSIndex
as soon as a time-out has been reached?
#define ipconfigDNS_USE_CALLBACKS 1
To make it more complicated, there are also asynchronous look-ups: FreeRTOS_gethostbyname_a()
. This will install an application hook which will be called as soon as a host-name has been found, or when a time-out has been reached.
Any simple suggestion for this? Thanks