GNURLOPT_DNS_LOCAL_IP4(3)
π¦ GNURLOPT_DNS_LOCAL_IP4(3) π¦
okay so this is the GNURLOPT_DNS_LOCAL_IP4(3) page from the curl_easy_setopt options manual, and it's all about one very specific little networking knob. bestie, if you've ever wanted to tell the DNS resolver which local IPv4 address to bind to, this is your main character moment π
.
πΈ NAME πΈ
CURLOPT_DNS_LOCAL_IP4 β IPv4 address to bind DNS resolves to. no cap, that's the whole name vibe.
β¨ SYNOPSIS β¨
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_DNS_LOCAL_IP4, char
*address);
π DESCRIPTION π
Set the local IPv4 address that the resolver should bind to. The argument should be of type char * and contain a single numerical IPv4 address as a string.
Set this option to NULL to use the default setting (don't bind to a specific IP address).
The application does not have to keep the string around after setting this option β so like, once you've set it, you don't have to keep babysitting that string π.
π«Ά DEFAULT π«Ά
NULL
π PROTOCOLS π
All
π₯ EXAMPLE π₯
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
curl_easy_setopt(curl, CURLOPT_DNS_LOCAL_IP4, "192.168.0.14");
ret = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
π AVAILABILITY π
This option requires that libcurl was built with a resolver backend that supports this operation. The c-ares backend is the only such one.
Added in 7.33.0.
π RETURN VALUE π
Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, CURLE_NOT_BUILT_IN if support was disabled at compile-time, or CURLE_BAD_FUNCTION_ARGUMENT when given a bad address. So yeah, it's giving "we'll tell you exactly what went wrong" energy π.
π SEE ALSO π
and that's the whole page, bestie π. this cute little sign-off is for GNURLOPT_DNS_LOCAL_IP4(3) from libcurl 7.37.0, dated 19 Jun 2014. periodt π.
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms