Fresolve
Bun

function

dns.promises.resolve

function resolve(
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:

<omitted>

On error, the Promise is rejected with an Error object, where err.code is one of the DNS error codes.

@param hostname

Host name to resolve.

function resolve(
hostname: string,
rrtype: 'A'
): 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:

<omitted>

On error, the Promise is rejected with an Error object, where err.code is one of the DNS error codes.

@param hostname

Host name to resolve.

@param rrtype

Resource record type.

function resolve(
hostname: string,
rrtype: 'AAAA'
): 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:

<omitted>

On error, the Promise is rejected with an Error object, where err.code is one of the DNS error codes.

@param hostname

Host name to resolve.

@param rrtype

Resource record type.

function resolve(
hostname: string,
rrtype: 'ANY'
): Promise<AnyRecord[]>;

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:

<omitted>

On error, the Promise is rejected with an Error object, where err.code is one of the DNS error codes.

@param hostname

Host name to resolve.

@param rrtype

Resource record type.

function resolve(
hostname: string,
rrtype: 'CAA'
): Promise<CaaRecord[]>;

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:

<omitted>

On error, the Promise is rejected with an Error object, where err.code is one of the DNS error codes.

@param hostname

Host name to resolve.

@param rrtype

Resource record type.

function resolve(
hostname: string,
rrtype: 'CNAME'
): 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:

<omitted>

On error, the Promise is rejected with an Error object, where err.code is one of the DNS error codes.

@param hostname

Host name to resolve.

@param rrtype

Resource record type.

function resolve(
hostname: string,
rrtype: 'MX'
): Promise<MxRecord[]>;

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:

<omitted>

On error, the Promise is rejected with an Error object, where err.code is one of the DNS error codes.

@param hostname

Host name to resolve.

@param rrtype

Resource record type.

function resolve(
hostname: string,
rrtype: 'NAPTR'
): Promise<NaptrRecord[]>;

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:

<omitted>

On error, the Promise is rejected with an Error object, where err.code is one of the DNS error codes.

@param hostname

Host name to resolve.

@param rrtype

Resource record type.

function resolve(
hostname: string,
rrtype: 'NS'
): 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:

<omitted>

On error, the Promise is rejected with an Error object, where err.code is one of the DNS error codes.

@param hostname

Host name to resolve.

@param rrtype

Resource record type.

function resolve(
hostname: string,
rrtype: 'PTR'
): 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:

<omitted>

On error, the Promise is rejected with an Error object, where err.code is one of the DNS error codes.

@param hostname

Host name to resolve.

@param rrtype

Resource record type.

function resolve(
hostname: string,
rrtype: 'SOA'
): Promise<SoaRecord>;

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:

<omitted>

On error, the Promise is rejected with an Error object, where err.code is one of the DNS error codes.

@param hostname

Host name to resolve.

@param rrtype

Resource record type.

function resolve(
hostname: string,
rrtype: 'SRV'
): Promise<SrvRecord[]>;

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:

<omitted>

On error, the Promise is rejected with an Error object, where err.code is one of the DNS error codes.

@param hostname

Host name to resolve.

@param rrtype

Resource record type.

function resolve(
hostname: string,
rrtype: 'TXT'
): 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:

<omitted>

On error, the Promise is rejected with an Error object, where err.code is one of the DNS error codes.

@param hostname

Host name to resolve.

@param rrtype

Resource record type.

function resolve(
hostname: string,
rrtype: string
): Promise<string[] | SoaRecord | AnyRecord[] | MxRecord[] | NaptrRecord[] | SrvRecord[] | 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:

<omitted>

On error, the Promise is rejected with an Error object, where err.code is one of the DNS error codes.

@param hostname

Host name to resolve.

@param rrtype

Resource record type.