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 ldns library functions manual, bestie edition πŸ’–

okay so welcome to ldns(3), aka the Library Functions Manual page for the ldns crew. this is where you learn how to make resource records, destroy them, and print them. it's giving creation, destruction, and printing. iconic trio honestly. 🌈


✨ NAME ✨

ldns_rr_new, ldns_rr_new_frm_type, ldns_rr_new_frm_str, ldns_rr_new_frm_fp, ldns_rr_free, ldns_rr_print β€” ldns_rr creation, destruction and printing πŸŽ€


✨ SYNOPSIS ✨

like, here's the whole vibe, fr fr:

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

#include <ldns/ldns.h>

ldns_rr* ldns_rr_new(void);

ldns_rr* ldns_rr_new_frm_type(ldns_rr_type t);

ldns_status ldns_rr_new_frm_str(ldns_rr **n, const char *str, uint32_t
default_ttl, const ldns_rdf *origin, ldns_rdf **prev);

ldns_status ldns_rr_new_frm_fp(ldns_rr **rr, FILE *fp, uint32_t
*default_ttl, ldns_rdf **origin, ldns_rdf **prev);

void ldns_rr_free(ldns_rr *rr);

void ldns_rr_print(FILE *output, const ldns_rr *rr);

✨ DESCRIPTION ✨

πŸ¦‹ ldns_rr_new()

creates a new rr structure. that's it, that's the whole thing. slay.

Returns ldns_rr * πŸ’…

πŸ¦‹ ldns_rr_new_frm_type()

creates a new rr structure, based on the given type. and bestie, it allocs enough space to hold all the rdf's. no cap.

πŸ¦‹ ldns_rr_new_frm_str()

creates an rr from a string. the string should be a fully filled-in rr, like this:

ownername <space> TTL <space> CLASS <space> TYPE <space> RDATA

the deets:

  • n: the rr to return
  • str: the string to convert
  • default_ttl: default ttl value for the rr. if it's 0, DEF_TTL will be used
  • origin: when the owner is relative, add this. the caller must ldns_rdf_deep_free it.
  • prev: the previous ownername. if this value is not NULL, the function overwrites this with the ownername found in this string. the caller must then ldns_rdf_deep_free it.

Returns a status msg describing an error or LDNS_STATUS_OK ⭐

πŸ¦‹ ldns_rr_new_frm_fp()

creates a new rr from a file containing a string. file-based glow up ✨

  • rr: the new rr
  • fp: the file pointer to use
  • default_ttl: pointer to a default ttl for the rr. if NULL, DEF_TTL will be used. the pointer will be updated if the file contains a $TTL directive
  • origin: when the owner is relative, add this. the pointer will be updated if the file contains a $ORIGIN directive. the caller must ldns_rdf_deep_free it.
  • prev: when the owner is whitespaces, use this as the * ownername. the pointer will be updated after the call. the caller must ldns_rdf_deep_free it.

Returns a ldns_status with an error or LDNS_STATUS_OK 🌸

πŸ¦‹ ldns_rr_free()

frees an RR structure. bye bestie πŸ‘‹

  • rr: the RR to be freed

Returns void

πŸ¦‹ ldns_rr_print()

prints the data in the resource record to the given file stream (in presentation format). it's giving showtime πŸ’…

  • output: the file stream to print to
  • rr: the resource record to print

Returns void


✨ AUTHOR ✨

the ldns team at NLnet Labs. kings and queens of DNS, periodt πŸ‘‘


✨ REPORTING BUGS ✨

pls pls pls report bugs to dns-team@nlnetlabs.nl or on GitHub at https://github.com/NLnetLabs/ldns/issues πŸ™ˆ we love a good bug report.


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.

ok so read that again, bestie. no warranty. none. zero. not even the fitness one. 😭

✨ SEE ALSO ✨

ldns_rr, ldns_rr_list. And perldoc Net::DNS, RFC1034, RFC1035, RFC4033, RFC4034 and RFC4035. go read the RFCs, they're long but they're the blueprint 🧚


✨ REMARKS ✨

This manpage was automatically generated from the ldns source code. (yes the robots wrote it. we just made it cute.) πŸ€–πŸ’–


and that's a wrap on ldns(3) from the Library Functions Manual, dated 30 May 2006 β€” ldns(3), we love you, mwah πŸ’œ