FreeRTOS How to Use Secondary DNS?

Hello,

I am working on a FreeRTOS project and the network that I am using has two separate DNS servers. This week the primary DNS server went down and my FreeRTOS devices no longer work. Is there a way that I can modify my devices to use the secondary DNS instead of the primary?

If I can find where this secondary DNS would be stored I should be able to solve this.

Thanks for anyone who decides to help!

Hello Drowsell - please share the version of FreeRTOS-Plus-TCP stack you are working on. Thanks.

FreeRTOS+TCP V2.4.0 is what I am using. Is this the information you were looking for?

Thank you.
Unfortunately V2.4.0 doesnt contain secondary DNS support. Refer to this open ticket → [Feature Request] Any plans to support a second DNS server? · Issue #564 · FreeRTOS/FreeRTOS-Plus-TCP · GitHub.

However, the good news is that we have addressed the feature request in our ongoing development branch here and will be part of our next release V4.0.0.

1 Like

Look forward to seeing this in a future release.

1 Like

As a temporary solution, you can change the DNS address as soon as you notify that all lookups fail.

The following function should set a new DNS address:

void vSetDNSAddress( uint32_t * ulDNSServerAddress )
{
    FreeRTOS_SetAddressConfiguration( NULL, /* pulIPAddress */
                                      NULL, /* pulNetMask */
                                      NULL, /* pulGatewayAddress */
                                      &ulDNSServerAddress );

And, if you like, look up the current DNS address:

uint32_t ulGetDNSAddress( void )
{
    uint32_t ulAddress;
    FreeRTOS_GetAddressConfiguration( NULL, /* pulIPAddress */
                                      NULL, /* pulNetMask */
                                      NULL, /* pulGatewayAddress */
                                      &ulAddress );
    return ulAddress;
2 Likes

Look forward to seeing this in a future release.

As Nikhil wrote, you can already find it in IPv6_integration.

It will most probably not be implemented in the current main branch.

1 Like