curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: DNS data not refreshed after CURLOPT_DNS_CACHE_TIMEOUT

From: Narasimha M via curl-library <curl-library_at_cool.haxx.se>
Date: Sun, 30 Aug 2020 07:34:41 +0530

Thanks for the reply.
Is there a way to force the name resolution/DNS checking periodically.
In my particular case, I would like to keep a single connection and check
for updates on the server using that connection forever.
Could you please explain when CURLOPT_DNS_CACHE_TIMEOUT is used?
As per my understanding CURLOPT_DNS_CACHE_TIMEOUT is the DNS cache timeout
for a given connection.
If the connection lives for more than this time and if the time between
performs is more than this time, resolution would be done.
Please Correct me if I am wrong

On Sun, Aug 30, 2020 at 3:38 AM Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Sun, 30 Aug 2020, Narasimha M via curl-library wrote:
>
> > If I set CURLOPT_DNS_CACHE_TIMEOUT to 2 sec, I expect the application to
> > contact the DNS server and resolve the name every 2 seconds. But I see
> that
> > DNS requests are sent only once for the first time and never thereafter.
>
> I think this is what happens:
>
> libcurl prioritizes reusing an existing "live" connection, and when doing
> so
> it doesn't have to resolve the host name. The entire loop is done using
> that
> single connection, so there was only one name resolve necessary.
>
> --
>
> / daniel.haxx.se | Commercial curl support up to 24x7 is available!
> | Private help, bug fixes, support, ports, new features
> | https://www.wolfssl.com/contact/
>

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2020-08-30