---
name: "dns_name_packet"
section: "3"
platform: "linux"
package: "libowfat-dev"
version: "0.32-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/dns_name_packet"
---

# dns\_name\_packet(3)

extract names from DNS answer packet

## NAME

dns\_name\_packet - extract names from DNS answer packet

## SYNTAX

**#include \<libowfat/dns.h\>**

int **dns\_name\_packet**(stralloc\* *out*,const char\* *buf*,\
                     unsigned int *len*);

## DESCRIPTION

dns\_name\_packet is a low-level component of dns\_name4, designed to support asynchronous DNS lookups. It reads a DNS packet of length *len* from *buf*, extracts the first PTR record from the answer section of the packet, puts the result into *out*, and returns 0 or -1 the same way as dns\_name4.

## SEE ALSO

[dns\_name4(3)](/dns_name4/3.md), [dns\_name6(3)](/dns_name6/3.md), [dns\_ip4\_packet(3)](/dns_ip4_packet/3.md)
