Runs a synchronous query for a given $NAME and $TYPE. $TYPE may be
expressed numerically or, for convenience, as a string. $CLASS is
optional and defaults to 1 (IN), which is probably what you want.
Returns a reference to a hash that corresponds
to a libunbound struct ub_result
(cf. libunbound(3)),
excluding len, answer_packet, and answer_len.
NOTE: Members of data are in their DNS-native RDATA encodings.
(libunbound doesn’t track which record type uses which encoding, so
neither does DNS::Unbound.)
To decode some common record types, see "CONVENIENCE FUNCTIONS" below.
OBJ->set_option( $NAME => $VALUE )
Sets a configuration option. Returns OBJ.
$value = OBJ->get_option( $NAME )
Gets a configuration option’s value.
CLASS->unbound_version()
Gives the libunbound version string.
CONVENIENCE FUNCTIONS
Note that Socket provides the inet_ntoa() and inet_ntop()
functions for decoding A and AAAA records.
The following may be called either as object methods or as static
functions (but not as class methods):
$decoded = decode_name($encoded)
Decodes a DNS name. Useful for, e.g., NS query results.
Note that this will normally include a trailing . because of the
trailing NUL byte in an encoded DNS name.
$strings_ar = decode_character_strings($encoded)
Decodes a list of character-strings into component strings,
returned as an array reference. Useful for TXT query results.