The manakai project


Resolve domain names using platform's resolver


  use Web::Transport::PlatformResolver;
  $resolver = Web::Transport::PlatformResolver->new;
  $resolver->resolve (Web::Host->parse_string (""))->then (sub {
    warn defined $_[0] && $_[0]->stringify;


The Web::Transport::PlatformResolver module defines a name resolver which resolves names using the system's resolution API.

This module is a resolver (see "RESOLVERS" in Web::Transport).


Following methods are available:

$resolver = Web::Transport::PlatformResolver->new

Create a resolver.

$promise = $resolver->resolve ($host, $name => $value, ...)

Resolve a domain.

The first argument must be a host (Web::Host) to resolve.

Additionally, following named arguments can be specified:

no_cache => $boolean

Ignored for this resolver (for now, at least). That is, the platform's DNS cache can't be disabled.

signal => $signal

The abort signal (AbortSignal) for the resolution. If the abort controller (AbortController) associated with the signal is aborted, the resolution is aborted and the method's promise is rejected with an object whose name is AbortError whenever possible.

debug => $debug

The debug mode. The default value is 0 (not in the debug mode). See WEBUA_DEBUG section in Web::Transport for available mode values.

The method returns a promise (Promise), which is to be resolved with the result. If the host is a domain and is successfully resolved into an IP address, or the host is an IP address, the promise is resolved with a host (Web::Host) representing that IP address. Otherwise, it is resolved with undef.




Web Transport Processing <>.


Wakaba <>.


Copyright 2016-2018 Wakaba <>.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.