Node dns.promises.resolve function | API Reference | Bun
BuildDocsReferenceGuidesBlogDiscord/
node:dns/promises/
resolveFresolve
Search the reference...
/
BuildDocsReferenceGuidesBlogDiscord/
node:dns/promises/
resolveFresolve
function
dns.promises.resolve
On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code`
is one of the [DNS error codes](https://nodejs.org/docs/latest-v20.x/api/dns.html#error-codes)." data-algolia-static="false" data-algolia-merged="false" data-type="Function">function
resolve(hostname: string): Promisestring[]>;
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.
@param hostname
Host name to resolve.
function
resolve(hostname: string,rrtype: 'A' | 'AAAA' | 'CNAME' | 'NS' | 'PTR'): Promisestring[]>;
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.
@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:
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:
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:
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:
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:
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:
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: 'TLSA'): Promise
TlsaRecord[]>;
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.
@param hostname
Host name to resolve.
@param rrtype
Resource record type.
function
resolve(hostname: string,rrtype: 'TXT'): Promisestring[][]>;
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.
@param hostname
Host name to resolve.
@param rrtype
Resource record type.
function
resolve(hostname: string,rrtype: string): Promisestring[] |
SoaRecord |
AnyRecord[] |
CaaRecord[] |
MxRecord[] |
NaptrRecord[] |
SrvRecord[] |
TlsaRecord[] | 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.
@param hostname
Host name to resolve.
@param rrtype
Resource record type.
Referenced typestype
AnyRecord =
AnyARecord |
AnyAaaaRecord |
AnyCaaRecord |
AnyCnameRecord |
AnyMxRecord |
AnyNaptrRecord |
AnyNsRecord |
AnyPtrRecord |
AnySoaRecord |
AnySrvRecord |
AnyTlsaRecord |
AnyTxtRecordinterface
CaaRecordcontactemail?: string
contactphone?: string
critical: number
iodef?: string
issue?: string
issuewild?: stringinterface
MxRecordexchange: string
priority: numberinterface
NaptrRecordflags: string
order: number
preference: number
regexp: string
replacement: string
service: stringinterface
SoaRecordexpire: number
hostmaster: string
minttl: number
nsname: string
refresh: number
retry: number
serial: numberinterface
SrvRecordname: string
port: number
priority: number
weight: numberinterface
TlsaRecordcertUsage: number
data:
ArrayBuffermatch: number
selector: number
Resources
ReferenceDocsGuidesDiscordMerch StoreGitHubBlog Toolkit
RuntimePackage managerTest runnerBundlerPackage runnerProject
Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicenseBaked with ❤️ in San Francisco
We're hiring →