ldns(3)
π 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 π
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. πβ¨ππ¦
π¦ 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