CURLOPT_IPRESOLVE - specify which IP protocol version to use
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_IPRESOLVE, long
Allows an application to select what kind of IP addresses to use when resolving
host names. This is only interesting when using host names that resolve
addresses using more than one version of IP. The allowed values are:
- Default, resolves addresses to all IP versions that your system
- Resolve to IPv4 addresses.
- Resolve to IPv6 addresses.
CURL *curl = curl_easy_init();
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
/* resolve host name using IPv6-names only */
curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V6);
ret = curl_easy_perform(curl);