Skip to main content

resolve

function resolve
Jump to headingresolve(hostname: string): Promise<string[]>

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 Jump to heading

Jump to headinghostname: string

Host name to resolve.

Return Type Jump to heading

Promise<string[]>
Jump to headingresolve(
hostname: string,
rrtype: "A",
): Promise<string[]>

Parameters Jump to heading

Jump to headinghostname: string
Jump to headingrrtype: "A"

Return Type Jump to heading

Promise<string[]>
Jump to headingresolve(
hostname: string,
rrtype: "AAAA",
): Promise<string[]>

Parameters Jump to heading

Jump to headinghostname: string
Jump to headingrrtype: "AAAA"

Return Type Jump to heading

Promise<string[]>
Jump to headingresolve(
hostname: string,
rrtype: "ANY",
): Promise<AnyRecord[]>

Parameters Jump to heading

Jump to headinghostname: string
Jump to headingrrtype: "ANY"

Return Type Jump to heading

Promise<AnyRecord[]>
Jump to headingresolve(
hostname: string,
rrtype: "CAA",
): Promise<CaaRecord[]>

Parameters Jump to heading

Jump to headinghostname: string
Jump to headingrrtype: "CAA"

Return Type Jump to heading

Promise<CaaRecord[]>
Jump to headingresolve(
hostname: string,
rrtype: "CNAME",
): Promise<string[]>

Parameters Jump to heading

Jump to headinghostname: string
Jump to headingrrtype: "CNAME"

Return Type Jump to heading

Promise<string[]>
Jump to headingresolve(
hostname: string,
rrtype: "MX",
): Promise<MxRecord[]>

Parameters Jump to heading

Jump to headinghostname: string
Jump to headingrrtype: "MX"

Return Type Jump to heading

Promise<MxRecord[]>
Jump to headingresolve(
hostname: string,
rrtype: "NAPTR",
): Promise<NaptrRecord[]>

Parameters Jump to heading

Jump to headinghostname: string
Jump to headingrrtype: "NAPTR"

Return Type Jump to heading

Promise<NaptrRecord[]>
Jump to headingresolve(
hostname: string,
rrtype: "NS",
): Promise<string[]>

Parameters Jump to heading

Jump to headinghostname: string
Jump to headingrrtype: "NS"

Return Type Jump to heading

Promise<string[]>
Jump to headingresolve(
hostname: string,
rrtype: "PTR",
): Promise<string[]>

Parameters Jump to heading

Jump to headinghostname: string
Jump to headingrrtype: "PTR"

Return Type Jump to heading

Promise<string[]>
Jump to headingresolve(
hostname: string,
rrtype: "SOA",
): Promise<SoaRecord>

Parameters Jump to heading

Jump to headinghostname: string
Jump to headingrrtype: "SOA"

Return Type Jump to heading

Promise<SoaRecord>
Jump to headingresolve(
hostname: string,
rrtype: "SRV",
): Promise<SrvRecord[]>

Parameters Jump to heading

Jump to headinghostname: string
Jump to headingrrtype: "SRV"

Return Type Jump to heading

Promise<SrvRecord[]>
Jump to headingresolve(
hostname: string,
rrtype: "TXT",
): Promise<string[][]>

Parameters Jump to heading

Jump to headinghostname: string
Jump to headingrrtype: "TXT"

Return Type Jump to heading

Promise<string[][]>
Jump to headingresolve(
hostname: string,
rrtype: string,
): Promise<
string[]
| MxRecord[]
| NaptrRecord[]
| SoaRecord
| SrvRecord[]
| string[][]
| AnyRecord[]
>

Parameters Jump to heading

Jump to headinghostname: string
Jump to headingrrtype: string

Return Type Jump to heading

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