ldns(3)
π 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 aLDNS_RR_TYPE_MXrr π₯r: the resource record- Returns a
ldns_rdf*with the preference, orNULLon failure π (we do not love failure but we respect the honesty)
ldns_rr_mx_exchange()β and this one returns the mx host of aLDNS_RR_TYPE_MXrr πr: the resource record- Returns a
ldns_rdf*with the name of the MX host, orNULLon 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 π
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 ππ π
π¦ where this page comes from
- alpine 3.22: ldns-doc 1.8.4-r0 Β· BSD-3-Clause
- alpine 3.23: ldns-doc 1.8.4-r1 Β· BSD-3-Clause
- alpine 3.24: ldns-doc 1.8.4-r1 Β· BSD-3-Clause
- arch rolling: ldns 1.9.2-1 Β· custom:BSD
- debian trixie: libldns-dev 1.8.4-2+b1
- fedora 43: ldns-devel 1.8.4-8.fc43 Β· BSD-3-Clause
- fedora 43: ldns-devel 1.8.4-8.fc43 Β· BSD-3-Clause
- fedora 43: ldns-devel 1.9.2-1.fc43 Β· BSD-3-Clause
- fedora 43: ldns-devel 1.9.2-1.fc43 Β· BSD-3-Clause
- fedora 44: ldns-devel 1.9.0-2.fc44 Β· BSD-3-Clause
- fedora 44: ldns-devel 1.9.0-2.fc44 Β· BSD-3-Clause
- fedora 44: ldns-devel 1.9.2-1.fc44 Β· BSD-3-Clause
- fedora 44: ldns-devel 1.9.2-1.fc44 Β· BSD-3-Clause
- nixos 26.05: ldns 1.9.2
- nixpkgs unstable: ldns 1.9.2
- opensuse-leap 16.0: ldns-devel 1.8.4-160000.3.1 Β· BSD-3-Clause
- opensuse-leap 16.0: ldns-devel 1.8.4-160000.3.1 Β· BSD-3-Clause
- opensuse-leap 16.0: ldns-devel 1.8.4-160000.3.1 Β· BSD-3-Clause
- opensuse-leap 16.0: ldns-devel 1.8.4-160000.3.1 Β· BSD-3-Clause
- ubuntu questing: libldns-dev 1.8.4-2build1
- ubuntu resolute: libldns-dev 1.8.4-2build3
- ubuntu stonking: libldns-dev 1.9.2-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms