ARES_SET_LOCAL_IP4(3)

πŸ“¦
version 1.34.9 Β· 4 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

🌸 NAME 🌸

okay bestie, this is the ares_set_local_ip4 page from the Library Functions Manual, and we're keeping it cute but fully factual πŸ’–

  • ares_set_local_ip4 β€” Set local IPv4 address outgoing requests.

no cap, that's the whole name section. periodt. πŸ’…


✨ SYNOPSIS ✨

here's the incantation, copy it exactly bestie:

#include <ares.h>

void ares_set_local_ip4(ares_channel_t *channel, unsigned int local_ip)

πŸ’… DESCRIPTION πŸ’…

so the ares_set_local_ip4 function sets the IP address for outbound requests. iconic behavior, honestly. ✨

the parameter local_ip is specified in host byte order. that part is important, don't skip it. 🫢

this allows users to specify outbound interfaces when used on multi-homed systems. it's giving "I have options and I'm choosing one." πŸ’…


πŸ¦‹ SEE ALSO πŸ¦‹

like, the IPv6 sibling. go check it out if you need the v6 version. πŸ¦‹


πŸŽ€ NOTES πŸŽ€

this function was added in c-ares 1.7.4. yes bestie, it's been around for a minute. πŸ‘‘


mwah πŸ’– this little page lives in the Library Functions Manual and is dated 30 June 2010, k byeeee πŸ’…βœ¨