1---
2c: Copyright (C) Daniel Stenberg, <daniel.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_DNS_LOCAL_IP6
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_DNS_INTERFACE (3)
9  - CURLOPT_DNS_LOCAL_IP4 (3)
10  - CURLOPT_DNS_SERVERS (3)
11---
12
13# NAME
14
15CURLOPT_DNS_LOCAL_IP6 - IPv6 address to bind DNS resolves to
16
17# SYNOPSIS
18
19~~~c
20#include <curl/curl.h>
21
22CURLcode curl_easy_setopt(CURL *handle, CURLOPT_DNS_LOCAL_IP6, char *address);
23~~~
24
25# DESCRIPTION
26
27Set the local IPv6 *address* that the resolver should bind to. The argument
28should be of type char * and contain a single IPv6 address as a string. Set
29this option to NULL to use the default setting (do not bind to a specific IP
30address).
31
32The application does not have to keep the string around after setting this
33option.
34
35# DEFAULT
36
37NULL
38
39# PROTOCOLS
40
41All
42
43# EXAMPLE
44
45~~~c
46int main(void)
47{
48  CURL *curl = curl_easy_init();
49  if(curl) {
50    CURLcode res;
51    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
52    curl_easy_setopt(curl, CURLOPT_DNS_LOCAL_IP6, "fe80::a9ff:fe46:b619");
53    res = curl_easy_perform(curl);
54    curl_easy_cleanup(curl);
55  }
56}
57~~~
58
59# AVAILABILITY
60
61This option requires that libcurl was built with a resolver backend that
62supports this operation. The c-ares backend is the only such one.
63
64Added in 7.33.0
65
66# RETURN VALUE
67
68Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not,
69CURLE_NOT_BUILT_IN if support was disabled at compile-time, or
70CURLE_BAD_FUNCTION_ARGUMENT when given a bad address.
71