A and AAAA
The A or AAAA records will be unpacked and returned in a list of strings.
The PTR records will be unpacked and returned in a list of domain names.
The MX records will be unpacked, in order of preference, and returned in a list of HASH references. Each HASH reference will contain keys called exchange and preference. If the exchange domain name is included in the DNS additional data, then the HASH reference will also include a key called address, its value containing a list of A and AAAA record address fields.
The SRV records will be unpacked and sorted first by order of priority, then by a weighted shuffle by weight, and returned in a list of HASH references. Each HASH reference will contain keys called priority, weight, target and port. If the target domain name is included in the DNS additional data, then the HASH reference will also contain a key called address, its value containing a list of A and AAAA record address fields.
The two possible back-end modules that implement the resolver query functions provided here differ in their semantics for error reporting. To account for this difference and to lead to more portable user code, errors reported by the back-end modules are translated to one of the following (exported) constants.
ERR_NO_HOST # The specified host name does not exist ERR_NO_ADDRESS # The specified host name does not provide answers for the given query type ERR_TEMPORARY # A temporary failure that may disappear on retry ERR_UNRECOVERABLE # Any other error
The following methods documented with a trailing call to ->get return Future instances.
( $pkt, @data ) = $resolver->res_query( %params )->get
Performs a resolver query on the name, class and type, and invokes a continuation when a result is obtained.
Takes the following named parameters:
On failure on IO::Async versions that support extended failure results (0.68 and later), the extra detail will be an error value matching one of the ERR_* constants listed above.
dname => STRING Domain name to look up type => STRING Name of the record type to look up (e.g. MX) class => STRING Name of the record class to look up. Defaults to IN so normally this argument is not required.
->fail( $message, resolve => res_query => $errnum )
Note that due to the two possible back-end implementations it is not guaranteed that messages have any particular format; they are intended for human consumption only, and the $errnum value should be used for making decisions in other code.
When not returning a Future, the following extra arguments are used as callbacks instead:
on_resolved => CODE Continuation which is invoked after a successful lookup. Will be passed a Net::DNS::Packet object containing the result.
$on_resolved->( $pkt )
For certain query types, this continuation may also be passed extra data in a list after the $pkt
$on_resolved->( $pkt, @data )
on_error => CODE Continuation which is invoked after a failed lookup.
Performs a resolver query on the name, class and type, and invokes a continuation when a result is obtained. Identical to res_query except that it additionally implements the default domain name search behaviour.
Paul Evans <firstname.lastname@example.org>
|perl v5.20.3||IO::ASYNC::RESOLVER::DNS (3)||2015-07-31|