ldns(3)
πΈ NAME πΈ
okay bestie, welcome to ldns(3) β this is the page for ldns_pkt_new, ldns_pkt_free, ldns_pkt_print, ldns_pkt_query_new, ldns_pkt_query_new_frm_str, and ldns_pkt_reply_type π
it's giving "ldns_pkt creation, destruction and printing" β making packets, yeeting packets, and showing packets off. iconic behaviour, no cap.
β¨ SYNOPSIS β¨
#include <stdint.h>
#include <stdbool.h>
#include <ldns/ldns.h>
ldns_pkt* ldns_pkt_new(void);
void ldns_pkt_free(ldns_pkt *packet);
void ldns_pkt_print(FILE *output, const ldns_pkt *pkt);
ldns_pkt* ldns_pkt_query_new(ldns_rdf *rr_name, ldns_rr_type rr_type,
ldns_rr_class rr_class, uint16_t flags);
ldns_status ldns_pkt_query_new_frm_str(ldns_pkt **p, const char
*rr_name, ldns_rr_type rr_type, ldns_rr_class rr_class , uint16_t
flags);
ldns_pkt_type ldns_pkt_reply_type(const ldns_pkt *p);
likeβ¦ the whole squad is here π«Ά
π DESCRIPTION π
π ldns_pkt_new()
allocates and initializes a ldns_pkt structure. brand new packet, fresh out the box, main character energy fr fr β¨
Returns pointer to the new packet.
π ldns_pkt_free()
frees the packet structure and all data that it contains. like, it does not leave crumbs β everything inside goes too. π
- packet: The packet structure to free
- Returns
void
π ldns_pkt_print()
prints the data in the DNS packet to the given file stream (in presentation format). it's the vibe check β you get to see the packet π¦
- output: the file stream to print to
- pkt: the packet to print
- Returns
void
π ldns_pkt_query_new()
creates a packet with a query in it for the given name, type and class. π
- rr_name: the name to query for (not copied). The returned packet will take ownership of rr_name, so the caller should not free it.
- rr_type: the type to query for
- rr_class: the class to query for
- flags: packet flags
- Returns
ldns_pkt*β a pointer to the new pkt
bestie listen, that "not copied / takes ownership" thing is REAL. you hand over rr_name and the packet claims it. free it yourself afterwards and it's over for you π
π ldns_pkt_query_new_frm_str()
creates a query packet for the given name, type, class β but this time the name comes in as a string, cute and convenient π
- p: the packet to be returned
- rr_name: the name to query for (as string)
- rr_type: the type to query for
- rr_class: the class to query for
- flags: packet flags
- Returns
LDNS_STATUS_OKor aldns_statusmesg with the error
π ldns_pkt_reply_type()
looks inside the packet to determine what kind of packet it is β AUTH, NXDOMAIN, REFERRAL, etc. detective mode πβ¨
- p: the packet to examine
- Returns the type of packet
π AUTHOR π
The ldns team at NLnet Labs. absolute legends, periodt.
π REPORTING BUGS π
Please report bugs to dns-team@nlnetlabs.nl or on GitHub at https://github.com/NLnetLabs/ldns/issues
(they wanna hear about it, fr fr β don't suffer in silence bestie)
π 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.
so real for that disclaimer. no warranty, not even a little one. use it responsibly π«Ά
π SEE ALSO π
ldns_pkt. And perldoc Net::DNS, RFC1034, RFC1035, RFC4033, RFC4034 and RFC4035. iykyk πβ¨
π§ REMARKS π§
This manpage was automatically generated from the ldns source code. (yes, a robot wrote it. still slay.)
and that's the whole page bestie β this was the ldns(3) manual from the Library Functions Manual, dated 30 May 2006 π go make some packets π
π¦ 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