In this link at the last it mentions

http://comments.gmane.org/gmane.comp.web.curl.library/40895

libcurl uses its DNS cache by default as long as you re-use the handle. You can change the time it'll hold entries in the cache - it is only meant to aid "spikes" or rapid requests to the same host names as it doesn't get the "true" TTL values.

I have gone through all the documentation of curl http://curl.haxx.se/docs/manpage.html but I could not find any way to change the time (TTL) curl hold entries in the cache.

How to set the curl cache item holding-time & how to clear the curl cache?

share|improve this question

See CURLOPT_DNS_CACHE_TIMEOUT:

Pass a long, this sets the timeout in seconds. Name resolves will be kept in memory and used for this number of seconds. Set to zero to completely disable caching, or set to -1 to make the cached entries remain forever. By default, libcurl caches this info for 60 seconds.

There is no explicit way to flush the dns cache other than closing the handle or possibly setting the timeout to 0 for the next request.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.