GNURLOPT_DNS_LOCAL_IP6(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

πŸ’– GNURLOPT_DNS_LOCAL_IP6(3) πŸ’–

okay so bestie, this is the GNURLOPT_DNS_LOCAL_IP6(3) page, and it lives in the curl_easy_setopt options manual. Buckle up, it's giving very specific IPv6 DNS binding energy. πŸ¦‹


✨ NAME ✨

CURLOPT_DNS_LOCAL_IP6 β€” the IPv6 address to bind DNS resolves to. periodt. πŸ’…

πŸŽ€ SYNOPSIS πŸŽ€

#include <gnurl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_DNS_LOCAL_IP6, char
       *address);

🌸 DESCRIPTION 🌸

okay so you're setting the local IPv6 address that the resolver should bind to. The argument should be of type char * and contain a single IPv6 address as a string. Set this option to NULL to use the default setting β€” aka don't bind to a specific IP address. 🫢

The application does not have to keep the string around after setting this option. so you can let it go, bestie, it's fine. 😭✨

πŸŽ€ DEFAULT πŸŽ€

NULL β€” iconic, unbothered, unbound. πŸ’…

🌈 PROTOCOLS 🌈

All 🌈

🧚 EXAMPLE 🧚

here's the whole vibe, copied exactly:

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_IP6, "fe80::a9ff:fe46:b619");
  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. iykyk. πŸŒ€

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. no cap, those are the possible outcomes. πŸ™ˆ

πŸ¦‹ SEE ALSO πŸ¦‹

CURLOPT_DNS_INTERFACE(3), CURLOPT_DNS_LOCAL_IP4(3), β€” yes, the trailing comma is canon. 🫢


mwah πŸ’‹ β€” this page is from libcurl 7.37.0, dated 19 Jun 2014, and it's literally titled GNURLOPT_DNS_LOCAL_IP6(3). bye bestie 🫢✨

πŸ“¦ where this page comes from