---
name: "Zonemaster::Packet"
section: "3pm"
platform: "linux"
package: "libzonemaster-perl"
version: "1.0.16-2.1"
release: "Debian 11 (Bullseye)"
platforms: ["linux"]
url: "https://new.carta.tech/Zonemaster::Packet"
---

# Zonemaster::Packet(3pm)

wrapping object for Net::LDNS::Packet objects

## NAME

Zonemaster::Packet - wrapping object for Net::LDNS::Packet objects

## SYNOPSIS

```
    my $packet = $ns->query('iis.se', 'NS');
    my @rrs = $packet->get_records('ns');
```

## ATTRIBUTES

- packet

  Holds the Net::LDNS::Packet the object is wrapping.

## METHODS

- no\_such\_record

  Returns true if the packet represents an existing DNS node lacking any records of the requested type.

- no\_such\_name

  Returns true if the packet represents a non-existent DNS node.

- is\_redirect

  Returns true if the packet is a redirect to another set of nameservers.

- get\_records($type\[, $section\])

  Returns the Net::LDNS::RR objects of the requested type in the packet. If the optional `$section` argument is given, and is one of `"answer"`, `"authority"` and `"additional"`, only RRs from that section are returned.

- get\_records\_for\_name($type, $name)

  Returns all Net::LDNS::RR objects for the given name in the packet.

- has\_rrs\_of\_type\_for\_name($type, $name)

  Returns true if the packet holds any RRs of the specified type for the given name.

- answerfrom

  Wrapper for the underlying packet method, that replaces udnefined values with the string `"<unknown>"`.

- TO\_JSON

  Support method for JSON to be able to serialize these objects.

## METHODS PASSED THROUGH

These methods are passed through transparently to the underlying Net::LDNS::Packet object.

- •

  data

- •

  rcode

- •

  aa

- •

  question

- •

  answer

- •

  authority

- •

  additional

- •

  print

- •

  string

- •

  answersize

- •

  unique\_push

- •

  timestamp

- •

  type

- •

  edns\_size

- •

  edns\_rcode

- •

  has\_edns

- •

  id

- •

  querytime

- •

  do

- •

  opcode
