Skip to main content
function resolve
resolve(hostname: string): Promise<string[]>
Deprecated

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.

Parameters

hostname: string

Host name to resolve.

Return Type

Promise<string[]>
resolve(
hostname: string,
rrtype: "A",
): Promise<string[]>
Deprecated

Parameters

hostname: string
rrtype: "A"

Return Type

Promise<string[]>
resolve(
hostname: string,
rrtype: "AAAA",
): Promise<string[]>
Deprecated

Parameters

hostname: string
rrtype: "AAAA"

Return Type

Promise<string[]>
resolve(
hostname: string,
rrtype: "ANY",
): Promise<AnyRecord[]>
Deprecated

Parameters

hostname: string
rrtype: "ANY"

Return Type

Promise<AnyRecord[]>
resolve(
hostname: string,
rrtype: "CAA",
): Promise<CaaRecord[]>
Deprecated

Parameters

hostname: string
rrtype: "CAA"

Return Type

Promise<CaaRecord[]>
resolve(
hostname: string,
rrtype: "CNAME",
): Promise<string[]>
Deprecated

Parameters

hostname: string
rrtype: "CNAME"

Return Type

Promise<string[]>
resolve(
hostname: string,
rrtype: "MX",
): Promise<MxRecord[]>
Deprecated

Parameters

hostname: string
rrtype: "MX"

Return Type

Promise<MxRecord[]>
resolve(
hostname: string,
rrtype: "NAPTR",
): Promise<NaptrRecord[]>
Deprecated

Parameters

hostname: string
rrtype: "NAPTR"

Return Type

Promise<NaptrRecord[]>
resolve(
hostname: string,
rrtype: "NS",
): Promise<string[]>
Deprecated

Parameters

hostname: string
rrtype: "NS"

Return Type

Promise<string[]>
resolve(
hostname: string,
rrtype: "PTR",
): Promise<string[]>
Deprecated

Parameters

hostname: string
rrtype: "PTR"

Return Type

Promise<string[]>
resolve(
hostname: string,
rrtype: "SOA",
): Promise<SoaRecord>
Deprecated

Parameters

hostname: string
rrtype: "SOA"

Return Type

Promise<SoaRecord>
resolve(
hostname: string,
rrtype: "SRV",
): Promise<SrvRecord[]>
Deprecated

Parameters

hostname: string
rrtype: "SRV"

Return Type

Promise<SrvRecord[]>
resolve(
hostname: string,
rrtype: "TXT",
): Promise<string[][]>
Deprecated

Parameters

hostname: string
rrtype: "TXT"

Return Type

Promise<string[][]>
resolve(
hostname: string,
rrtype: string,
): Promise<
string[]
| MxRecord[]
| NaptrRecord[]
| SoaRecord
| SrvRecord[]
| string[][]
| AnyRecord[]
>
Deprecated

Parameters

hostname: string
rrtype: string

Return Type

Promise<
string[]
| MxRecord[]
| NaptrRecord[]
| SoaRecord
| SrvRecord[]
| string[][]
| AnyRecord[]
>
Back to top