Nresolve
Bun

namespace

dns.resolve

function resolve(
hostname: string,
callback: (err: null | ErrnoException, addresses: string[]) => void
): void;

Uses the DNS protocol to resolve a host name (e.g. 'nodejs.org') into an array of the resource records. The callback function has arguments (err, records). When successful, records will be an array of resource records. The type and structure of individual results varies based on rrtype:

<omitted>

On error, err is 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',
callback: (err: null | ErrnoException, addresses: string[]) => void
): void;

Uses the DNS protocol to resolve a host name (e.g. 'nodejs.org') into an array of the resource records. The callback function has arguments (err, records). When successful, records will be an array of resource records. The type and structure of individual results varies based on rrtype:

<omitted>

On error, err is 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',
callback: (err: null | ErrnoException, addresses: string[]) => void
): void;

Uses the DNS protocol to resolve a host name (e.g. 'nodejs.org') into an array of the resource records. The callback function has arguments (err, records). When successful, records will be an array of resource records. The type and structure of individual results varies based on rrtype:

<omitted>

On error, err is 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',
callback: (err: null | ErrnoException, addresses: AnyRecord[]) => void
): void;

Uses the DNS protocol to resolve a host name (e.g. 'nodejs.org') into an array of the resource records. The callback function has arguments (err, records). When successful, records will be an array of resource records. The type and structure of individual results varies based on rrtype:

<omitted>

On error, err is 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',
callback: (err: null | ErrnoException, addresses: string[]) => void
): void;

Uses the DNS protocol to resolve a host name (e.g. 'nodejs.org') into an array of the resource records. The callback function has arguments (err, records). When successful, records will be an array of resource records. The type and structure of individual results varies based on rrtype:

<omitted>

On error, err is 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',
callback: (err: null | ErrnoException, addresses: MxRecord[]) => void
): void;

Uses the DNS protocol to resolve a host name (e.g. 'nodejs.org') into an array of the resource records. The callback function has arguments (err, records). When successful, records will be an array of resource records. The type and structure of individual results varies based on rrtype:

<omitted>

On error, err is 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',
callback: (err: null | ErrnoException, addresses: NaptrRecord[]) => void
): void;

Uses the DNS protocol to resolve a host name (e.g. 'nodejs.org') into an array of the resource records. The callback function has arguments (err, records). When successful, records will be an array of resource records. The type and structure of individual results varies based on rrtype:

<omitted>

On error, err is 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',
callback: (err: null | ErrnoException, addresses: string[]) => void
): void;

Uses the DNS protocol to resolve a host name (e.g. 'nodejs.org') into an array of the resource records. The callback function has arguments (err, records). When successful, records will be an array of resource records. The type and structure of individual results varies based on rrtype:

<omitted>

On error, err is 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',
callback: (err: null | ErrnoException, addresses: string[]) => void
): void;

Uses the DNS protocol to resolve a host name (e.g. 'nodejs.org') into an array of the resource records. The callback function has arguments (err, records). When successful, records will be an array of resource records. The type and structure of individual results varies based on rrtype:

<omitted>

On error, err is 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',
callback: (err: null | ErrnoException, addresses: SoaRecord) => void
): void;

Uses the DNS protocol to resolve a host name (e.g. 'nodejs.org') into an array of the resource records. The callback function has arguments (err, records). When successful, records will be an array of resource records. The type and structure of individual results varies based on rrtype:

<omitted>

On error, err is 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',
callback: (err: null | ErrnoException, addresses: SrvRecord[]) => void
): void;

Uses the DNS protocol to resolve a host name (e.g. 'nodejs.org') into an array of the resource records. The callback function has arguments (err, records). When successful, records will be an array of resource records. The type and structure of individual results varies based on rrtype:

<omitted>

On error, err is 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',
callback: (err: null | ErrnoException, addresses: string[][]) => void
): void;

Uses the DNS protocol to resolve a host name (e.g. 'nodejs.org') into an array of the resource records. The callback function has arguments (err, records). When successful, records will be an array of resource records. The type and structure of individual results varies based on rrtype:

<omitted>

On error, err is 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,
callback: (err: null | ErrnoException, addresses: string[] | SoaRecord | AnyRecord[] | MxRecord[] | NaptrRecord[] | SrvRecord[] | string[][]) => void
): void;

Uses the DNS protocol to resolve a host name (e.g. 'nodejs.org') into an array of the resource records. The callback function has arguments (err, records). When successful, records will be an array of resource records. The type and structure of individual results varies based on rrtype:

<omitted>

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

@param hostname

Host name to resolve.

@param rrtype

Resource record type.

namespace resolve