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: Daniel Stenberg via curl-library <curl-library_at_cool.haxx.se>
Date: Sun, 30 Aug 2020 00:08:51 +0200 (CEST)

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