functionresolve(string$name,array$options =[]):Amp\Promise

Resolve a hostname name to an IP address [hostname as defined by RFC 3986]

Upon success the returned promise resolves to an indexed array of the form:

[string $recordValue, int $type, int $ttl]

A null $ttl value indicates the DNS name was resolved from the cache or the local hosts file. $type being one constant from Amp\Dns\Record


If the custom per-request "server" option is not present the resolver will use the first nameserver in /etc/resolv.conf or default to Google's public DNS servers on Windows or if /etc/resolv.conf is not found.

Type Parameter Description Default Value
string $name The hostname to resolve none
array $options No documentation. []