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_zone β€” the zone bestie manual πŸ’–

okay so this is page ldns(3) from the Library Functions Manual, and it's literally all about creating, destroying and printing ldns_zone things. Buckle up, we're doing zones today. πŸ¦‹


✨ NAME ✨

ldns_zone, ldns_zone_new, ldns_zone_free, ldns_zone_deep_free, ldns_zone_new_frm_fp, ldns_zone_new_frm_fp_l, ldns_zone_print, ldns_zone_print_fmt β€” ldns_zone creation, destruction and printing. That's the whole vibe. Making zones, yeeting zones, showing zones off. πŸ’…


🌸 SYNOPSIS 🌸

Bestie, here's what you gotta pull in first:

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

#include <ldns/ldns.h>

And here are the functions themselves, no cap, exactly as they are:

ldns_zone * ldns_zone_new(void);

void ldns_zone_free(ldns_zone *zone);

void ldns_zone_deep_free(ldns_zone *zone);

ldns_status ldns_zone_new_frm_fp(ldns_zone **z, FILE *fp, const ldns_rdf
*origin, uint32_t ttl, ldns_rr_class c);

ldns_status ldns_zone_new_frm_fp_l(ldns_zone **z, FILE *fp, const
ldns_rdf *origin, uint32_t ttl, ldns_rr_class c, int *line_nr);

void ldns_zone_print(FILE *output, const ldns_zone *z);

void ldns_zone_print_fmt(FILE *output, const ldns_output_format *fmt,
const ldns_zone *z);

πŸŽ€ DESCRIPTION πŸŽ€

πŸ’œ ldns_zone

DNS Zone β€” say it with your chest. πŸ‘‘

It's a list of RR's with some extra info that comes from the SOA RR. And heads up: literally nothing has been done to make this efficient (yet). It's giving "we'll optimize later" energy and honestly, same.

struct ldns_struct_zone
{
     the soa defines a zone:
     ldns_rr   *_soa;
     /* basically a zone is a list of rr's */
     ldns_rr_list   *_rrs;
     /* we could change this to be a b-tree etc etc todo */
};
typedef struct ldns_struct_zone ldns_zone;

Not the todo comment in the source 😭 iconic. Anyway.


🌈 ldns_zone_new()

Creates a brand new ldns_zone structure. ✨

Returns a pointer to a ldns_zone structure.


🧚 ldns_zone_free()

Frees the allocated memory for the zone, and the rr_list structure inside it.

  • zone β€” the zone to free.

πŸ’€ ldns_zone_deep_free()

Okay this one goes deep deep. It frees the allocated memory for the zone, the soa rr inside it, and the rr_list structure inside it, including the rr's in that. Etc.

  • zone β€” the zone to free.
Careful bestie β€” this is the deep one. It takes everything with it, not just the outer shell. πŸ™ˆ

πŸ¦‹ ldns_zone_new_frm_fp()

Creates a new zone from a file. πŸ“‚

  • z β€” the new zone.
  • *fp β€” the filepointer to use.
  • *origin β€” the zones' origin.
  • ttl β€” default ttl to use.
  • c β€” default class to use (IN).

Returns an ldns_status mesg with an error, or LDNS_STATUS_OK if it ate. βœ…


⭐ ldns_zone_new_frm_fp_l()

Same as above but it keeps track of the line numbering, which is lowkey so helpful when something breaks.

  • z β€” the new zone.
  • *fp β€” the filepointer to use.
  • *origin β€” the zones' origin.
  • ttl β€” default ttl to use.
  • c β€” default class to use (IN).
  • line_nr β€” used for error msg, to get to the line number.

Returns an ldns_status mesg with an error, or LDNS_STATUS_OK. 🫢


🌸 ldns_zone_print()

Prints a zone structure * to output. Note the SOA record is included in this output β€” it's not shy, it shows up. πŸ’–

  • output β€” the fd to print to.
  • z β€” the zone to print.

πŸ“ ldns_zone_print_fmt()

Prints a zone structure * to output. Note the SOA record is included in this output too. Same deal, different format.

  • output β€” the fd to print to.
  • fmt β€” format of the textual representation.
  • z β€” the zone to print.

πŸ‘‘ AUTHOR πŸ‘‘

The ldns team at NLnet Labs. Absolute legends, fr fr.


πŸ› REPORTING BUGS πŸ›

Found a bug? Please report bugs to dns-team@nlnetlabs.nl or on GitHub at https://github.com/NLnetLabs/ldns/issues. Don't sit on it, bestie, tell them. πŸ’Œ


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. Read that again. No warranty. None. 😭


πŸ” SEE ALSO πŸ”

perldoc Net::DNS, RFC1034, RFC1035, RFC4033, RFC4034 and RFC4035. Go read them, iykyk. πŸ“š


🫢 REMARKS 🫢

This manpage was automatically generated from the ldns source code. Not me finding out the manpage didn't even get hand-written 😭 the robots did it and they ate.


k byeee, this page was ldns(3) from the Library Functions Manual, dated 30 May 2006, and that's the whole thing. slay, stay safe, and always deep_free responsibly. πŸ’–βœ¨πŸŽ€πŸ¦‹