ARES_SET_SORTLIST(3)
π ARES_SET_SORTLIST β the sort your DNS results era
okay bestie, gather round, because this one is from the Library Functions Manual and it is lowkey iconic. We're talking ares_set_sortlist(3), the function that decides what order your addresses come back in. Main character energy fr fr. π
β¨ NAME β¨
ares_set_sortlist β Initialize an ares_channel_t *sortlist configuration π¦
β¨ SYNOPSIS β¨
#include <ares.h>
int ares_set_sortlist(ares_channel_t *channel, const char *sortstr)
like, two args, one int, we're literally so back π
β¨ DESCRIPTION β¨
so the ares_set_sortlist(3) function initializes an address sortlist configuration for the channel data identified by channel, so that addresses returned by ares_gethostbyname(3) are sorted according to the sortlist. no cap, it's giving custom order π
The sortstr string you hand it holds a space separated list of IP-address-netmask pairs. The netmask is optional β but if it's there, it follows the address after a slash. For example:
"130.155.160.0/255.255.240.0 130.155.0.0"
see how the second one said "no netmask for me, I'm free"? yeah. optional fr.
β οΈ heads up bestie: this function replaces any potentially previously configured address sortlist with the ones given in the configuration string. so if you had a sortlist before, it's gone-gone. bye. π
β¨ RETURN VALUES β¨
ares_set_sortlist(3) may return any of the following values, and yes we're listing every single one because we don't skip β¨
ARES_SUCCESSβ the sortlist configuration was successfully initialized. slay!! πARES_ENOMEMβ the process's available memory was exhausted. π tragic.ARES_ENODATAβ the channel data identified by channel was invalid. π©ARES_ENOTINITIALIZEDβ c-ares library initialization not yet performed. bestie you gotta init first!! π
β¨ SEE ALSO β¨
go read those too, iykyk π«Ά
β¨ AVAILABILITY β¨
ares_set_sortlist(3) was added in c-ares 1.11.0 β
and that's the whole page, bestie π this one came from the Library Functions Manual and was dated 23 November 2015 β a vintage classic, honestly, still serving looks. now go sort those addresses. periodt. ππ
β¨
π¦ where this page comes from
- alpine 3.22: c-ares-doc 1.34.9-r0 Β· MIT
- alpine 3.23: c-ares-doc 1.34.9-r0 Β· MIT
- alpine 3.24: c-ares-doc 1.34.9-r0 Β· MIT
- arch rolling: c-ares 1.34.9-1 Β· MIT
- centos-stream 10: c-ares-devel 1.34.9-1.el10 Β· MIT
- debian trixie: libc-ares-dev 1.34.5-1+deb13u1 Β· MIT
- fedora 43: c-ares-devel 1.34.5-2.fc43 Β· MIT
- fedora 43: c-ares-devel 1.34.5-2.fc43 Β· MIT
- fedora 43: c-ares-devel 1.34.8-1.fc43 Β· MIT
- fedora 43: c-ares-devel 1.34.8-1.fc43 Β· MIT
- fedora 44: c-ares-devel 1.34.6-3.fc44 Β· MIT
- fedora 44: c-ares-devel 1.34.6-3.fc44 Β· MIT
- fedora 44: c-ares-devel 1.34.8-1.fc44 Β· MIT
- fedora 44: c-ares-devel 1.34.8-1.fc44 Β· MIT
- nixos 26.05: c-ares 1.34.9
- nixpkgs unstable: c-ares 1.34.8
- opensuse-leap 16.0: c-ares-devel 1.34.8-160000.1.1 Β· MIT
- opensuse-leap 16.0: c-ares-devel 1.34.8-160000.1.1 Β· MIT
- opensuse-leap 16.0: c-ares-devel 1.34.8-160000.1.1 Β· MIT
- opensuse-leap 16.0: c-ares-devel 1.34.8-160000.1.1 Β· MIT
- ubuntu noble: libc-ares-dev 1.27.0-1.0ubuntu1
- ubuntu noble: libc-ares-dev 1.27.0-1.0ubuntu1.1
- ubuntu questing: libc-ares-dev 1.34.5-1
- ubuntu questing: libc-ares-dev 1.34.5-1ubuntu0.1
- ubuntu resolute: libc-ares-dev 1.34.6-1 Β· MIT
- ubuntu resolute: libc-ares-dev 1.34.6-1ubuntu0.1
- ubuntu resolute: libc-ares-dev 1.34.6-1ubuntu0.2 Β· MIT
- ubuntu stonking: libc-ares-dev 1.34.8-1 Β· MIT
- π the page's license: MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms