1CURLOPT_DNS_USE_GLOBAL_CACHEc(u3r)l_easy_setopt optiCoUnRsLOPT_DNS_USE_GLOBAL_CACHE(3)
2
3
4
6 CURLOPT_DNS_USE_GLOBAL_CACHE - enable/disable global DNS cache
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_DNS_USE_GLOBAL_CACHE,
12 long enable);
13
15 Has no function since 7.62.0. Do not use!
16
17 Pass a long. If the enable value is 1, it tells curl to use a global
18 DNS cache that will survive between easy handle creations and dele‐
19 tions. This is not thread-safe and this will use a global variable.
20
21 WARNING: this option is considered obsolete. Stop using it. Switch over
22 to using the share interface instead! See CURLOPT_SHARE(3) and
23 curl_share_init(3).
24
26 0
27
29 All
30
32 CURL *curl = curl_easy_init();
33 if(curl) {
34 CURLcode ret;
35 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
36 /* switch off the use of a global, thread unsafe, cache */
37 curl_easy_setopt(curl, CURLOPT_DNS_USE_GLOBAL_CACHE, 0L);
38 ret = curl_easy_perform(curl);
39 curl_easy_cleanup(curl);
40 }
41
43 Deprecated since 7.62.0. Has no function.
44
46 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION
47 if not.
48
50 CURLOPT_SHARE(3), CURLOPT_DNS_CACHE_TIMEOUT(3),
51
52
53
54libcurl 7.76.1 November 04, 2020CURLOPT_DNS_USE_GLOBAL_CACHE(3)