dns_ip6_qualify(3)

πŸ“¦
version 0.34 Β· 2 versions
  • 0.34 Β· alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 0.30 Β· fedora 43, fedora 44, ubuntu jammy
, in alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– dns_ip6_qualify β€” from the Library Functions Manual, bestie πŸ’–

okay so picture this: you're in <libowfat/dns.h, it's giving resolver era, and you need a name qualified AND its IPv6 addresses looked up. that's literally this function's whole job. slay. πŸ’…


✨ NAME ✨

dns_ip6_qualify β€” qualify a name and look up IPv6 addresses πŸ¦‹


🌸 SYNTAX 🌸

#include <libowfat/dns.h>

int dns_ip6_qualify(stralloc* out,stralloc* fqdn,
                    const stralloc* udn);

πŸ’« DESCRIPTION πŸ’«

so here's the vibe: dns_ip6_qualify takes the name udn, feeds it through qualification, and then looks up 16-byte IPv6 addresses for whatever comes out the other side. no cap. πŸ”₯

here's what it does with all of that:

  • it puts the fully qualified domain name into fqdn
  • it puts the concatenation of the IP addresses into out
  • it returns 0

and if the domain doesn't exist in DNS, or it just has no IP addresses at all? out will be empty. it's giving ghosted. 😭

ngl the cute part is this: dns_ip6_qualify also looks up 4-byte IPv4 addresses and converts them into IPv4-mapped IPv6 addresses (::ffff:1.2.3.4) so that IPv6 apps get easy backwards compatibility. iconic behaviour, honestly. πŸ‘‘

but bestie, listen β€” if dns_ip6_qualify has trouble with the qualification, or has trouble with DNS, or just runs out of memory, it returns -1 and sets errno appropriately. and here's the spicy bit: it may or may not change out and fqdn. so don't be out here assuming they're untouched, fr fr. πŸ’€

⚠️ heads up: -1 means something went wrong, and out / fqdn are in a maybe state. check errno, don't trust the buffers blindly. πŸ™ˆ

πŸŽ€ QUALIFICATION πŸŽ€

for the full qualification lore, go read:

http://cr.yp.to/djbdns/qualification.html


🌈 SEE ALSO 🌈


and that's the whole page, bestie 🫢 straight from the Library Functions Manual, filed under dns_ip6_qualify(3) β€” no date on this one, she's timeless like that. go qualify something. πŸ’œβœ¨