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

NAME

6       CURLOPT_DNS_INTERFACE - set interface to speak DNS over
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode  curl_easy_setopt(CURL  *handle,  CURLOPT_DNS_INTERFACE,  char
12       *ifname);
13

DESCRIPTION

15       Pass a char * as parameter. Set the name of the network interface  that
16       the DNS resolver should bind to. This must be an interface name (not an
17       address). Set this option to NULL to use  the  default  setting  (don't
18       bind to a specific interface).
19
20       The  application  does not have to keep the string around after setting
21       this option.
22

DEFAULT

24       NULL
25

PROTOCOLS

EXAMPLE

28       CURL *curl = curl_easy_init();
29       if(curl) {
30         curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
31         curl_easy_setopt(curl, CURLOPT_DNS_INTERFACE, "eth0");
32         ret = curl_easy_perform(curl);
33         curl_easy_cleanup(curl);
34       }
35

AVAILABILITY

37       Added in 7.33.0. This option also requires that libcurl was built  with
38       a  resolver backend that supports this operation. The c-ares backend is
39       the only such one.
40

RETURN VALUE

42       Returns CURLE_OK if the option is  supported,  CURLE_UNKNOWN_OPTION  if
43       not, or CURLE_NOT_BUILT_IN if support was disabled at compile-time.
44

SEE ALSO

46       CURLOPT_DNS_SERVERS(3), CURLOPT_DNS_LOCAL_IP4(3),
47
48
49
50libcurl 7.69.1                   May 31, 2017         CURLOPT_DNS_INTERFACE(3)
Impressum