dns_ip6(3)
β¨ dns_ip6 β the glow-up where your fqdn becomes IPv6 addresses β¨
ok bestie, we're in the dns_ip6(3) zone, part of the Library Functions Manual π this is the function you call when you want IPv6 addresses and you want them now.
π NAME π
dns_ip6 β look up IPv6 addresses
πΈ SYNTAX πΈ
#include <libowfat/dns.h>
int dns_ip6(stralloc* out,stralloc* fqdn);
π¦ DESCRIPTION π¦
so here's the tea, dns_ip6 goes and looks up 16-byte IPv6 addresses for the fully-qualified domain name sitting in fqdn. it takes the concatenation of all those IPv6 addresses and drops them into out, then returns 0. iconic behavior honestly. π«Ά
and if the domain literally doesn't exist in DNS, or it exists but has no IP addresses at all? then out will just be empty. no addresses, no drama. π
dns_ip6 is also so thoughtful because it looks up 4-byte IPv4 addresses too and converts them into IPv4-mapped IPv6 addresses like ::ffff:1.2.3.4 β which gives you easy backwards compatibility for IPv6 applications. it's giving main character energy, it's giving "I got you covered." π
now, if dns_ip6 hits trouble with the DNS lookup or runs out of memory, it returns -1 and sets errno appropriately. and here's the spicy part: it may or may not change out. so don't go assuming anything about out in that case, fr fr. π
β οΈ ngl, that "may or may not changeout" thing is real β when it returns-1, treatoutas unreliable. no cap.
and the bestie shortcut: if fqdn is already an IPv6 address, dns_ip6 puts that IP address straight into out without checking DNS. no lookup, no waiting, just vibes. β¨ IPv4 addresses are also used directly without DNS lookup. so either way, if you handed it an address, it's not gonna go bother the resolver about it. periodt. π
π SEE ALSO π
and that's the whole page, bestie π this lil legend lives in the Library Functions Manual and it signs off as dns_ip6(3) β go forth and resolve some addresses, you've got this ππΈπ¦
π¦ where this page comes from
- alpine 3.24: libowfat-doc 0.34-r0 Β· GPL-2.0-only
- debian bookworm: libowfat-dev 0.32-4 Β· GPL-2.0-only
- debian trixie: libowfat-dev 0.32-5 Β· GPL-2.0-only
- nixos 26.05: libowfat 0.34
- nixpkgs unstable: libowfat 0.34
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- ubuntu noble: libowfat-dev 0.32-4.1build1 Β· GPL-2.0-only
- ubuntu questing: libowfat-dev 0.32-5
- ubuntu resolute: libowfat-dev 0.34-2 Β· GPL-2.0-only
- ubuntu stonking: libowfat-dev 0.34-2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms