DNS::Un...:Result(3)

πŸ“¦ version 0.29, in alpine 3.24

okay so welcome to DNS::Un...:Result(3), the User Contributed Perl Documentation page for the class DNS::Unbound::Result. The header is a little truncated, but we move. πŸ’…

πŸŽ€ NAME πŸŽ€

DNS::Unbound::Result

yup, that's the class. main character energy only.

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so this class literally represents a DNS query result from DNS::Unbound. That's the whole vibe. No cap. ✨

πŸ’– ACCESSORS πŸ’–

This class includes an accessor for most members of "struct ub_result" (cf. libunbound(3) (https://nlnetlabs.nl/documentation/unbound/libunbound/)).

The following all return scalars:

  • qname(), qtype(), qclass(), ttl()
  • rcode(), nxdomain(), havedata(), canonname()
  • secure(), bogus(), why_bogus(), "answer_packet"

data() returns an array reference of byte strings that contain the query result in DNS-native RDATA encoding. periodt. 🫢

πŸ”₯ ADDITIONAL METHODS πŸ”₯

🌟 $objs_ar = OBJ->to_net_dns_rrs() 🌟

IMPORTANT: This method is DEPRECATED and will be withdrawn in a forthcoming version. Please migrate to the following logic instead (assuming an instance of this class in $result):
my $packet = Net::DNS::Packet->new( \$result->answer_packet() );

… which will yield a Net::DNS::Packet instance.

The DEPRECATED method’s documentation follows:

The data() accessor’s return values are raw RDATA. Your application likely prefers to work with parsed DNS data, though. This method facilitates that by loading Net::DNS::RR and returning a reference to an array of instances of that class (i.e., probably a subclass of it like Net::DNS::RR::NS).

So, for example, to get a TXT query result’s value as a list of character strings, you could do:

@cstrings = map { $_->txtdata() } @{ $result->to_net_dns_rrs() }

mwah πŸ’‹ this page is brought to you by perl v5.42.2, dated 2026-02-15, and the manual name is DNS::Un...:Result(3). slay and goodbye. πŸ‘‘

πŸ“¦ where this page comes from