dns_mx_packet(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_mx_packet(3) ✨

okay so bestie, welcome to the dns_mx_packet page β€” it lives in the Library Functions Manual, section 3, and it is lowkey the backstage crew of DNS lookups. πŸŽ€


🌸 NAME 🌸

dns_mx_packet β€” pull the MX records out of a DNS answer packet πŸ’Œ


πŸ¦‹ SYNTAX πŸ¦‹

#include <libowfat/dns.h>

int dns_mx_packet(stralloc* out,const char* buf,
                  unsigned int len);

πŸ’… DESCRIPTION πŸ’…

So dns_mx_packet is a low-level component of dns_mx, and the whole reason it exists is to make asynchronous DNS lookups possible. iykyk. 🫢

Here's the vibe: it reads a DNS packet of length len out of buf, extracts the MX records from the answer section of that packet, drops the result into out, and then returns 0 or -1 β€” exactly the same way dns_mx does. no cap, same energy, same return values. ✨

bestie this is the plumbing-level function fr fr β€” if you just wanna do a normal MX lookup, go hang with dns_mx instead. this one is for when you are the one juggling the packets. 😭

🌈 SEE ALSO 🌈


and that's the whole page, periodt πŸ’– that was dns_mx_packet(3), straight out of the Library Functions Manual, page 3, and honestly? iconic. go read dns_mx(3) next, ily, bye πŸ‘‘πŸŒΈ