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