dns_name4_domain(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_name4_domain β€” ok so hear me out bestie πŸ’–

Library Functions Manual ✨ the dns_name4_domain(3) page, but make it a group chat πŸŽ€


🌸 NAME 🌸

dns_name4_domain β€” construct host name for reverse lookup πŸ¦‹


✨ SYNTAX ✨

#include <libowfat/dns.h>

void dns_name4_domain(char q[DNS_NAME4_DOMAIN],
                     const char* ip[4]);

yes the array size is literally right there in the signature, she's not being mysterious πŸ’…


πŸ’œ DESCRIPTION πŸ’œ

Okay so. dns_name4_domain is a low-level component of dns_name4 β€” like, she's the backstage queen, not the headliner. πŸ‘‘

What she does is so satisfying: she takes an IP address like 1.2.3.4 and flips it into a domain name like 4.3.2.1.in-addr.arpa β€” yes the octets go backwards, that's the whole reverse-lookup vibe, iykyk 🌈 β€” and then she places the packet-encoded domain name into q. 🫢

Not me emphasizing that it's packet-encoded, because it is, and that matters. πŸ’€

  • q is zero terminated. βœ…
  • q must have space for DNS_NAME4_DOMAIN bytes. No cap, no negotiating, no "maybe a little less". 😭
🚨 bestie warning: if q doesn't have DNS_NAME4_DOMAIN bytes of room, that's on you and it will not be cute. Give her the space she asked for. πŸ™ˆ

🌟 SEE ALSO 🌟

the whole little reverse-lookup friend group, love that for them πŸ’–


Okay bye ily!! πŸ’œ This one lives in the Library Functions Manual, and the footer of the page is literally just dns_name4_domain(3) again β€” she said "my name is my name," periodt. πŸ‘‘ No date, no version drama, just the title showing up at the bottom like a little signature. πŸŽ€βœ¨πŸŒΈ