---
name: "Zonemaster::Engine::Packet"
section: "3pm"
platform: "linux"
package: "libzonemaster-perl"
version: "7.1.0-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Zonemaster::Engine::Packet"
---

# Zonemaster::Engine::Packet(3pm)

wrapping object for Zonemaster::LDNS::Packet objects

## NAME

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

## SYNOPSIS

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

## ATTRIBUTES

- packet

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

## CONSTRUCTORS

- new

  Construct a new instance.

## 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 nonexistent DNS node.

- is\_redirect

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

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

  Returns the Zonemaster::LDNS::RR objects of the requested type in the packet. If the optional `@section` argument is given, and is a list of `"answer"`, `"authority"` and `"additional"`, only RRs from those sections are returned.

- get\_records\_for\_name($type, $name\[, @section\])

  Returns all Zonemaster::LDNS::RR objects for the given name in the packet. If the optional `@section` argument is given, and is a list of `"answer"`, `"authority"` and `"additional"`, only RRs from those sections are returned.

- has\_rrs\_of\_type\_for\_name($type, $name\[, @section\])

  Returns true if the packet holds any RRs of the specified type for the given name. If the optional `@section` argument is given, and is a list of `"answer"`, `"authority"` and `"additional"`, only RRs from those sections are returned.

- answerfrom

  Wrapper for the underlying packet method, that replaces undefined 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 Zonemaster::LDNS::Packet object.

- data

  - rcode

  - aa

  - ra

  - tc

  - question

  - answer

  - authority

  - additional

  - string

  - unique\_push

  - timestamp

  - type

  - edns\_size

  - edns\_rcode

  - edns\_version

  - edns\_z

  - edns\_data

  - has\_edns

  - id

  - querytime

  - do

  - opcode
