ldns(3)

πŸ“¦
version 1.9.2 Β· 2 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’Œ ldns(3) β€” the girlies' guide to MX rdata fields πŸ’Œ

okay so bestie, welcome to ldns(3), from the Library Functions Manual πŸŽ€ this is the lil corner of the ldns world where you pull the good stuff out of an MX resource record β€” and honestly? it's giving very demure, very mindful, very two functions and we're done ✨


🌸 NAME 🌸

ldns_rr_mx_preference, ldns_rr_mx_exchange β€” get MX RR rdata fields πŸ’–

no literally that's the whole job. two functions. one record type. slay.


✨ SYNOPSIS ✨

first, you gotta bring your friends. include the squad:

#include <stdint.h>
#include <stdbool.h>

#include <ldns/ldns.h>

then here are the two main characters πŸ‘‘

ldns_rdf* ldns_rr_mx_preference(const ldns_rr *r);

ldns_rdf* ldns_rr_mx_exchange(const ldns_rr *r);

that's it. that's the whole vibe check. πŸ¦‹


πŸ’… DESCRIPTION πŸ’…

so here's the tea, fr fr:

  • ldns_rr_mx_preference() β€” this one returns the mx pref. of a LDNS_RR_TYPE_MX rr πŸ”₯
    • r: the resource record
    • Returns a ldns_rdf* with the preference, or NULL on failure 😭 (we do not love failure but we respect the honesty)
  • ldns_rr_mx_exchange() β€” and this one returns the mx host of a LDNS_RR_TYPE_MX rr 🌈
    • r: the resource record
    • Returns a ldns_rdf* with the name of the MX host, or NULL on failure 😭 (again. the drama.)

like, preference = the priority number, exchange = the host name. both come back as ldns_rdf* and both can hand you NULL if things go sideways, so check your return values bestie, i am begging πŸ™ˆ


πŸ‘‘ AUTHOR πŸ‘‘

The ldns team at NLnet Labs. icons only, no notes 🫢


πŸ› REPORTING BUGS πŸ›

found a bug? do NOT suffer in silence, that's not the energy. report it to dns-team@nlnetlabs.nl or on GitHub at https://github.com/NLnetLabs/ldns/issues πŸ’œ they genuinely want to know, periodt.


Copyright (c) 2004 - 2006 NLnet Labs.

Licensed under the BSD License. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

okay important one: that "NO warranty" is in all caps for a reason πŸ’€ it means exactly what it says β€” no promises, no safety net. use it, love it, but don't come for them if it doesn't do the thing.

πŸ” SEE ALSO πŸ”

go read these too, they're the extended universe:

iykyk πŸ“šβœ¨


🧚 REMARKS 🧚

This manpage was automatically generated from the ldns source code. yes, a robot wrote it. no, that does not make it less valid. we respect the machine πŸ€–πŸ’–


and that's the whole page babes!! this little masterpiece is from 30 May 2006, and it lives under ldns(3) β€” go forth and fetch those MX fields, you absolute legend πŸŒŸπŸ’…πŸŽ€