---
name: "ldns_pkt_section"
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_pkt_section"
---

# ldns\_pkt\_section(3)

request or answer packets types

## NAME

ldns\_pkt, ldns\_pkt\_section, ldns\_pkt\_type - request or answer packets types

## SYNOPSIS

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

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

 ldns\_pkt\_section();

 ldns\_pkt\_type();

## DESCRIPTION

*ldns\_pkt*\
 DNS packet\

This structure contains a complete DNS packet (either a query or an answer)\

It is the complete representation of what you actually send to a\
 nameserver, and what it sends back (assuming you are the client here).\
 struct ldns\_struct\_pkt\
 {\
\
 	**Header section:**\
\
 	ldns\_hdr \*\_header;\
\
 	/\* extra items needed in a packet \*/\
\
 	**an rdf (A or AAAA) with the IP address of the server it is from:**\
\
 	ldns\_rdf \*\_answerfrom;\
\
         **Timestamp of the time the packet was sent or created:**\
\
 	struct timeval timestamp;\
\
 	**The duration of the query this packet is an answer to:**\
\
 	uint32\_t \_querytime;\
\
 	**The size of the wire format of the packet in octets:**\
\
 	size\_t \_size;\
\
 	**Optional tsig rr:**\
\
 	ldns\_rr \*\_tsig\_rr;\
\
 	**EDNS0 available buffer size, see RFC2671:**\
\
 	uint16\_t \_edns\_udp\_size;\
\
 	**EDNS0 Extended rcode:**\
\
 	uint8\_t \_edns\_extended\_rcode;\
\
 	**EDNS Version:**\
\
 	uint8\_t \_edns\_version;\
\
 	/\* OPT pseudo-RR presence flag \*/\
\
 	uint8\_t \_edns\_present;\
\
 	**Reserved EDNS data bits:**\
\
 	uint16\_t \_edns\_z;\
\
 	**Arbitrary EDNS rdata:**\
\
 	ldns\_rdf \*\_edns\_data;\
\
 	**Structed EDNS data:**\
\
 	ldns\_edns\_option\_list \*\_edns\_list;\
\
 	**Question section:**\
\
 	ldns\_rr\_list	\*\_question;\
\
 	**Answer section:**\
\
 	ldns\_rr\_list	\*\_answer;\
\
 	**Authority section:**\
\
 	ldns\_rr\_list	\*\_authority;\
\
 	**Additional section:**\
\
 	ldns\_rr\_list	\*\_additional;\
 };\
 typedef struct ldns\_struct\_pkt ldns\_pkt;

*ldns\_pkt\_section*()

*ldns\_pkt\_type*()

## 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\_pkt\_new*, *ldns\_pkt\_free*, *ldns\_pkt\_print*, *ldns\_pkt\_query\_new*, *ldns\_pkt\_query\_new\_frm\_str*, *ldns\_pkt\_reply\_type*, *ldns\_pkt\_id*, *ldns\_pkt\_qr*, *ldns\_pkt\_aa*, *ldns\_pkt\_tc*, *ldns\_pkt\_rd*, *ldns\_pkt\_cd*, *ldns\_pkt\_ra*, *ldns\_pkt\_ad*, *ldns\_pkt\_get\_opcode*, *ldns\_pkt\_get\_rcode*, *ldns\_pkt\_qdcount*, *ldns\_pkt\_ancount*, *ldns\_pkt\_nscount*, *ldns\_pkt\_arcount*, *ldns\_pkt\_answerfrom*, *ldns\_pkt\_querytime*, *ldns\_pkt\_size*, *ldns\_pkt\_tsig*, *ldns\_pkt\_question*, *ldns\_pkt\_answer*, *ldns\_pkt\_authority*, *ldns\_pkt\_additional*, *ldns\_pkt\_get\_section\_clone*, *ldns\_pkt\_rr\_list\_by\_name*, *ldns\_pkt\_rr\_list\_by\_type*, *ldns\_pkt\_rr\_list\_by\_name\_and\_type*, *ldns\_pkt\_set\_flags*, *ldns\_pkt\_set\_id*, *ldns\_pkt\_set\_qr*, *ldns\_pkt\_set\_aa*, *ldns\_pkt\_set\_tc*, *ldns\_pkt\_set\_rd*, *ldns\_pkt\_set\_cd*, *ldns\_pkt\_set\_ra*, *ldns\_pkt\_set\_ad*, *ldns\_pkt\_set\_opcode*, *ldns\_pkt\_set\_rcode*, *ldns\_pkt\_set\_qdcount*, *ldns\_pkt\_set\_ancount*, *ldns\_pkt\_set\_nscount*, *ldns\_pkt\_set\_arcount*, *ldns\_pkt\_set\_answerfrom*, *ldns\_pkt\_set\_querytime*, *ldns\_pkt\_set\_size*, *ldns\_pkt\_set\_section\_count*, *ldns\_pkt\_set\_tsig*, *ldns\_pkt\_edns*, *ldns\_pkt\_edns\_udp\_size*, *ldns\_pkt\_edns\_extended\_rcode*, *ldns\_pkt\_edns\_version*, *ldns\_pkt\_edns\_z*, *ldns\_pkt\_edns\_unassigned*, *ldns\_pkt\_edns\_data*, *ldns\_pkt\_set\_edns\_udp\_size*, *ldns\_pkt\_set\_edns\_extended\_rcode*, *ldns\_pkt\_set\_edns\_version*, *ldns\_pkt\_set\_edns\_z*, *ldns\_pkt\_set\_edns\_unassigned*, *ldns\_pkt\_set\_edns\_data*. And **perldoc Net::DNS**, **RFC1034**, **RFC1035**, **RFC4033**, **RFC4034**  and **RFC4035**.

## REMARKS

This manpage was automatically generated from the ldns source code.
