GNURLOPT_DNS_USE_GLOBAL_CACHE(3)
πΈ NAME πΈ
okay so bestie, this is the GNURLOPT_DNS_USE_GLOBAL_CACHE(3) page, living its best life inside the curl_easy_setopt options manual β and the whole point is CURLOPT_DNS_USE_GLOBAL_CACHE β enable/disable global DNS cache. lowkey a relic, but we're covering it fr fr π
β¨ SYNOPSIS β¨
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_DNS_USE_GLOBAL_CACHE,
long enable);
π¦ DESCRIPTION π¦
okay so boom: has no function since 7.62.0. Do note use! (the page literally says that, and it's giving warning-label drama π)
You pass a long. If the enable value is 1, it tells curl to use a global DNS cache that will survive between easy handle creations and deletions. This is not thread-safe and this will use a global variable.
β οΈ WARNING: this option is considered obsolete. Stop using it. Switch over to using the share interface instead! SeeCURLOPT_SHARE(3)andcurl_share_init(3). π¨
π DEFAULT π
0
π PROTOCOLS π
All
π EXAMPLE π
CURL *curl = curl_easy_init();
if(curl) {
CURLcode ret;
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
/* switch off the use of a global, thread unsafe, cache */
curl_easy_setopt(curl, CURLOPT_DNS_USE_GLOBAL_CACHE, 0L);
ret = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
π AVAILABILITY π
Deprecated since 7.62.0. Has no function. π
π RETURN VALUE π
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. periodt.
π§ SEE ALSO π§
okay bye bestie π this page was brought to you by libcurl 7.37.0, dated 17 Jun 2014, and the manual name is still the iconic GNURLOPT_D...LOBAL_CACHE(3). slay β¨
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms