---
name: "ldns_zone"
section: "3"
platform: "linux"
package: "ldns"
version: "1.9.2-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/ldns_zone"
---

# ldns\_zone(3)

ldns\_zone creation, destruction and printing

## 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

## SYNOPSIS

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

\#include \<ldns/ldns.h\>

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\

A list of RR's with some\
 extra information which comes from the SOA RR\
 Note: nothing has been done to make this efficient (yet).\
 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;

*ldns\_zone\_new*() create a new ldns\_zone structure .br Returns a pointer to a ldns\_zone structure

*ldns\_zone\_free*() Frees the allocated memory for the zone, and the rr\_list structure in it .br **zone**: the zone to free

*ldns\_zone\_deep\_free*() Frees the allocated memory for the zone, the soa rr in it,  and the rr\_list structure in it, including the rr's in that. etc. .br **zone**: the zone to free

*ldns\_zone\_new\_frm\_fp*() Create a new zone from a file .br **z**: the new zone .br **\*fp**: the filepointer to use .br **\*origin**: the zones' origin .br **ttl**: default ttl to use .br **c**: default class to use (IN)

.br Returns ldns\_status mesg with an error or LDNS\_STATUS\_OK

*ldns\_zone\_new\_frm\_fp\_l*() Create a new zone from a file, keep track of the line numbering .br **z**: the new zone .br **\*fp**: the filepointer to use .br **\*origin**: the zones' origin .br **ttl**: default ttl to use .br **c**: default class to use (IN) .br **line\_nr**: used for error msg, to get to the line number

.br Returns ldns\_status mesg with an error or LDNS\_STATUS\_OK

*ldns\_zone\_print*() Print a zone structure \* to output. Note the SOA record is included in this output .br **output**: the fd to print to .br **z**: the zone to print

*ldns\_zone\_print\_fmt*() Print a zone structure \* to output. Note the SOA record is included in this output .br **output**: the fd to print to .br **fmt**: format of the textual representation .br **z**: the zone to print

## AUTHOR

The ldns team at NLnet Labs.

## REPORTING BUGS

Please report bugs to dns-team@nlnetlabs.nl or on GitHub at https://github.com/NLnetLabs/ldns/issues

## 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.

## SEE ALSO

**perldoc Net::DNS**, **RFC1034**, **RFC1035**, **RFC4033**, **RFC4034** and **RFC4035**.

## REMARKS

This manpage was automatically generated from the ldns source code.
