---
name: "ldns_rr_free"
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_rr_free"
---

# ldns\_rr\_free(3)

ldns\_rr creation, destruction and printing

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

\#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. .br Returns ldns\_rr \*

*ldns\_rr\_new\_frm\_type*() creates a new rr structure, based on the given type. alloc enough space to hold all the rdf's

*ldns\_rr\_new\_frm\_str*() creates an rr from a string. The string should be a fully filled-in rr, like ownername &lt;space&gt; TTL &lt;space&gt; CLASS &lt;space&gt; TYPE &lt;space&gt; RDATA. .br **n**: the rr to return .br **str**: the string to convert .br **default\_ttl**: default ttl value for the rr. If 0 DEF\_TTL will be used .br **origin**: when the owner is relative add this. The caller must ldns\_rdf\_deep\_free it. .br **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. .br 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. .br **rr**: the new rr .br **fp**: the file pointer to use .br **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 .br **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. .br **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. .br Returns a ldns\_status with an error or LDNS\_STATUS\_OK

*ldns\_rr\_free*() frees an RR structure .br **\*rr**: the RR to be freed .br Returns void

*ldns\_rr\_print*() Prints the data in the resource record to the given file stream (in presentation format)

.br **output**: the file stream to print to .br **rr**: the resource record to print .br Returns void

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

*ldns\_rr*, *ldns\_rr\_list*. And **perldoc Net::DNS**, **RFC1034**, **RFC1035**, **RFC4033**, **RFC4034**  and **RFC4035**.

## REMARKS

This manpage was automatically generated from the ldns source code.
