1CURLOPT_IPRESOLVE(3)       curl_easy_setopt options       CURLOPT_IPRESOLVE(3)
2
3
4

NAME

6       CURLOPT_IPRESOLVE - specify which IP protocol version to use
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode   curl_easy_setopt(CURL   *handle,   CURLOPT_IPRESOLVE,   long
12       resolve);
13

DESCRIPTION

15       Allows an application to select what kind of IP addresses to  use  when
16       resolving  host  names.  This is only interesting when using host names
17       that resolve addresses using more than one version of IP.  The  allowed
18       values are:
19
20       CURL_IPRESOLVE_WHATEVER
21              Default,  resolves addresses to all IP versions that your system
22              allows.
23
24       CURL_IPRESOLVE_V4
25              Resolve to IPv4 addresses.
26
27       CURL_IPRESOLVE_V6
28              Resolve to IPv6 addresses.
29

DEFAULT

31       CURL_IPRESOLVE_WHATEVER
32

PROTOCOLS

34       All
35

EXAMPLE

37       CURL *curl = curl_easy_init();
38       if(curl) {
39         curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
40
41         /* resolve host name using IPv6-names only */
42         curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V6);
43
44         ret = curl_easy_perform(curl);
45
46         curl_easy_cleanup(curl);
47       }
48
49

AVAILABILITY

51       Always
52

RETURN VALUE

54       Returns CURLE_OK
55

SEE ALSO

57       CURLOPT_HTTP_VERSION(3), CURLOPT_SSLVERSION(3),
58
59
60
61libcurl 7.71.1                   May 05, 2017             CURLOPT_IPRESOLVE(3)
Impressum