resolveAsync
Uses the DNS protocol to resolve a host name (e.g. 'nodejs.org'
) into an array of the resource records. When successful, the Promise
is resolved with an array of resource records. The type and structure of individual results vary based on rrtype
:
On error, the Promise
is rejected with an Error
object, where err.code
is one of the DNS error codes.
Since
v10.6.0
Parameters
hostname
Host name to resolve.
rrtype='A' Resource record type.
external fun resolveAsync(hostname: String, rrtype: ResourceRecordType.A): Promise<ReadonlyArray<String>>(source)
external fun resolveAsync(hostname: String, rrtype: ResourceRecordType.AAAA): Promise<ReadonlyArray<String>>(source)
external fun resolveAsync(hostname: String, rrtype: ResourceRecordType.ANY): Promise<ReadonlyArray<AnyRecord>>(source)
external fun resolveAsync(hostname: String, rrtype: ResourceRecordType.CAA): Promise<ReadonlyArray<CaaRecord>>(source)
external fun resolveAsync(hostname: String, rrtype: ResourceRecordType.CNAME): Promise<ReadonlyArray<String>>(source)
external fun resolveAsync(hostname: String, rrtype: ResourceRecordType.MX): Promise<ReadonlyArray<MxRecord>>(source)
external fun resolveAsync(hostname: String, rrtype: ResourceRecordType.NAPTR): Promise<ReadonlyArray<NaptrRecord>>(source)
external fun resolveAsync(hostname: String, rrtype: ResourceRecordType.NS): Promise<ReadonlyArray<String>>(source)
external fun resolveAsync(hostname: String, rrtype: ResourceRecordType.PTR): Promise<ReadonlyArray<String>>(source)
external fun resolveAsync(hostname: String, rrtype: ResourceRecordType.SOA): Promise<SoaRecord>(source)
external fun resolveAsync(hostname: String, rrtype: ResourceRecordType.SRV): Promise<ReadonlyArray<SrvRecord>>(source)
external fun resolveAsync(hostname: String, rrtype: ResourceRecordType.TXT): Promise<ReadonlyArray<ReadonlyArray<String>>>(source)