lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] DNS lookup table or dynamic local hostlist?


From: Simon Goldschmidt
Subject: Re: [lwip-users] DNS lookup table or dynamic local hostlist?
Date: Sun, 17 Feb 2019 19:33:10 +0100
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0


On 16.02.2019 20:58, Roman Lwip wrote:
Hi,

I am using lwip as part of the espressif/arduino-esp32 library and there is something I don't understand.

My question is about DNS implementation of lwip:
https://github.com/espressif/arduino-esp32/blob/master/tools/sdk/include/lwip/lwip/dns.h

If I understand correctly there is a lookup table, which contains the host names, which have been queried before and their ip adress. Can I add a host to that lookup table during runtime?


Yes, see |DNS_LOCAL_HOSTLIST, ||DNS_LOCAL_HOSTLIST_ISDYNAMIC and ||dns_local_addhost().|

||

|
|

So what I want is this: The ESP32 wakes up and only does the DNS query (dns_gethostbyname), if the IP address of an MQTT server has changed, because an IP change of that server is not likely to happen often. So I would save the IP address over deep sleep and use it again, when the ESP wakes up. Do I need a dynamic host list for that (the DNS_LOCAL_HOSTLIST macro is undefined now)? Or can I edit the lookup table directly?


No, you can't edit the lookup table directly. However, I don't get how you detect the IP address has changed without using dns, as that's what dns is for...?


Regards,

Simon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]