bare-dns
Domain name resolution for JavaScript
v2.3.0bare-dns — Domain name resolution for JavaScript. It is a native addon and requires Bare >=1.33.0. A Bare older than that refuses to load it with an UNSUPPORTED_ENGINE error on every platform, not only Android. v2.2.1 required >=1.7.0.
Mirrors the Node.js dns module.
npm i bare-dnsUsage
const dns = require('bare-dns')
dns.lookup('github.com', (err, address, family) => {
console.log(address, family)
})Android
Added in v2.3.0. bare-dns sends its DNS protocol queries with c-ares. The c-ares documentation says that on Android 8 and newer, the system's DNS servers can only be read through the application's ConnectivityManager, and that the application needs the ACCESS_NETWORK_STATE permission. The ConnectivityManager has to come from the host application, so the addon asks the host for it.
When the addon first loads in the operating system process, it reads two keys from the embedder context: bare.android.jvm.v1 and bare.android.context.v1. It calls getSystemService("connectivity") on the application context, then passes the JVM and the ConnectivityManager to c-ares. The host must publish both keys before the first addon loads. The thread that loads the addon must be attached to the JVM, because the addon calls GetEnv() on it and asserts that the call succeeds. As of bare-kit 2.5.5, Bare Kit publishes bare.android.jvm.v1 but not bare.android.context.v1, so an application that embeds Bare through Bare Kit skips this step unless something else publishes that key.
If either key is not published, or the ConnectivityManager cannot be obtained, the addon skips this step without an error. c-ares then has no manager, and its documentation says DNS resolution does not work on Android 8 or newer without one when the application targets API level 26 or higher. dns.lookup() uses the operating system's getaddrinfo() and does not depend on any of this.
API
dns
dns.AnyRecord
type AnyRecord = | ({ type: 'A' } & RecordWithTTL)
| ({ type: 'AAAA' } & RecordWithTTL)
| { type: 'CNAME'; value: string }
| { type: 'NS'; value: string }
| { type: 'PTR'; value: string }
| { type: 'TXT'; entries: string[] }
| ({ type: 'MX' } & MXRecord)
| ({ type: 'SRV' } & SRVRecord)
| ({ type: 'NAPTR' } & NAPTRRecord)
| ({ type: 'SOA' } & SOARecord)dns.cancel(): void
dns.constants
dns.constants: {
readonly type: {
readonly A: 1
readonly NS: 2
readonly CNAME: 5
readonly SOA: 6
readonly PTR: 12
readonly HINFO: 13
readonly MX: 15
readonly TXT: 16
readonly SIG: 24
readonly AAAA: 28
readonly SRV: 33
readonly NAPTR: 35
readonly OPT: 41
readonly TLSA: 52
readonly SVCB: 64
readonly HTTPS: 65
readonly ANY: 255
readonly URI: 256
readonly CAA: 257
}
readonly status: Record<string, number>
}dns.getServers(): string[]
dns.IPFamily
type IPFamily = 4 | 6The IP address family: 4 for IPv4 or 6 for IPv6.
dns.lookup
dns.lookup(hostname: string, cb: (err: Error | null, address: string | null, family: IPFamily | 0) => void): voidResolve hostname into an IP address using the operating system's getaddrinfo facility, not
the DNS protocol directly. With all: true, the callback receives every resolved address
instead of just the first.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
hostname | string | — | The host name to resolve. |
cb | (err: Error | null, address: string | null, family: IPFamily | 0) => void | — | Called with (err, address, family), or (err, addresses) when all: true. |
dns.RecordType
type RecordType = | 'A'
| 'AAAA'
| 'ANY'
| 'CAA'
| 'CNAME'
| 'MX'
| 'NAPTR'
| 'NS'
| 'PTR'
| 'SOA'
| 'SRV'
| 'TLSA'
| 'TXT'dns.resolve: DNSResolver['resolve']
dns.resolve4: DNSResolver['resolve4']
dns.resolve6: DNSResolver['resolve6']
dns.resolveAny: DNSResolver['resolveAny']
dns.resolveCaa: DNSResolver['resolveCaa']
dns.resolveCname: DNSResolver['resolveCname']
dns.resolveMx: DNSResolver['resolveMx']
dns.resolveNaptr: DNSResolver['resolveNaptr']
dns.resolveNs: DNSResolver['resolveNs']
dns.resolvePtr: DNSResolver['resolvePtr']
dns.resolveSoa: DNSResolver['resolveSoa']
dns.resolveSrv: DNSResolver['resolveSrv']
dns.resolveTlsa: DNSResolver['resolveTlsa']
dns.resolveTxt: DNSResolver['resolveTxt']
Use the DNS protocol to resolve TXT records for hostname, on the global resolver. The callback receives an array of records, each itself an array of the strings that make up that record.
dns.reverse: DNSResolver['reverse']
dns.setLocalAddress(ipv4?: string | null, ipv6?: string | null): void
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
ipv4? | string | null | — | — |
ipv6? | string | null | — | — |
dns.setServers(servers: string[]): void
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
servers | string[] | — | — |
DNSResolver
The module exports this class as dns.Resolver, so create one with new dns.Resolver(). DNSResolver is its name in the type declarations, and dns.DNSResolver does not exist.
new DNSResolver(opts?: DNSResolverOptions)
An independent resolver for DNS queries over the DNS protocol, with its own servers and local address. Each instance keeps its own set of outstanding queries, which cancel() aborts and destroy() releases.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
opts? | DNSResolverOptions | — | — |
DNSResolver.cancel(): void
Aborts every query outstanding on this resolver. Each pending callback is
invoked with ECANCELLED.
DNSResolver.destroy(): void
Cancels every query outstanding on this resolver, so that none is left without an answer, and releases the resources it holds. A query made after this throws.
DNSResolver.global: DNSResolver
DNSResolver.getServers(): string[]
resolve(hostname: string, cb: Callback<string[]>): void
Overloads:
resolve(hostname: string, cb: Callback<string[]>): void
resolve(hostname: string, rrtype: 'A' | 'AAAA' | 'CNAME' | 'NS' | 'PTR', cb: Callback<string[]>): void
resolve(hostname: string, rrtype: 'TXT', cb: Callback<string[][]>): void
resolve(hostname: string, rrtype: 'MX', cb: Callback<MXRecord[]>): void
resolve(hostname: string, rrtype: 'SRV', cb: Callback<SRVRecord[]>): void
resolve(hostname: string, rrtype: 'NAPTR', cb: Callback<NAPTRRecord[]>): void
resolve(hostname: string, rrtype: 'SOA', cb: Callback<SOARecord>): void
resolve(hostname: string, rrtype: 'CAA', cb: Callback<CAARecord[]>): void
resolve(hostname: string, rrtype: 'TLSA', cb: Callback<TLSARecord[]>): void
resolve(hostname: string, rrtype: 'ANY', cb: Callback<AnyRecord[]>): voidParameters
| Parameter | Type | Default | Description |
|---|---|---|---|
hostname | string | — | — |
cb | Callback<string[]> | — | — |
resolve4(hostname: string, cb: Callback<string[]>): void
Overloads:
resolve4(hostname: string, cb: Callback<string[]>): void
resolve4(hostname: string, opts: { ttl?: false }, cb: Callback<string[]>): void
resolve4(hostname: string, opts: { ttl: true }, cb: Callback<RecordWithTTL[]>): voidParameters
| Parameter | Type | Default | Description |
|---|---|---|---|
hostname | string | — | — |
cb | Callback<string[]> | — | — |
resolve6(hostname: string, cb: Callback<string[]>): void
Overloads:
resolve6(hostname: string, cb: Callback<string[]>): void
resolve6(hostname: string, opts: { ttl?: false }, cb: Callback<string[]>): void
resolve6(hostname: string, opts: { ttl: true }, cb: Callback<RecordWithTTL[]>): voidParameters
| Parameter | Type | Default | Description |
|---|---|---|---|
hostname | string | — | — |
cb | Callback<string[]> | — | — |
resolveAny(hostname: string, cb: Callback<AnyRecord[]>): void
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
hostname | string | — | — |
cb | Callback<AnyRecord[]> | — | — |
resolveCaa(hostname: string, cb: Callback<CAARecord[]>): void
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
hostname | string | — | — |
cb | Callback<CAARecord[]> | — | — |
resolveCname(hostname: string, cb: Callback<string[]>): void
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
hostname | string | — | — |
cb | Callback<string[]> | — | — |
resolveMx(hostname: string, cb: Callback<MXRecord[]>): void
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
hostname | string | — | — |
cb | Callback<MXRecord[]> | — | — |
resolveNaptr(hostname: string, cb: Callback<NAPTRRecord[]>): void
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
hostname | string | — | — |
cb | Callback<NAPTRRecord[]> | — | — |
resolveNs(hostname: string, cb: Callback<string[]>): void
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
hostname | string | — | — |
cb | Callback<string[]> | — | — |
resolvePtr(hostname: string, cb: Callback<string[]>): void
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
hostname | string | — | — |
cb | Callback<string[]> | — | — |
resolveSoa(hostname: string, cb: Callback<SOARecord>): void
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
hostname | string | — | — |
cb | Callback<SOARecord> | — | — |
resolveSrv(hostname: string, cb: Callback<SRVRecord[]>): void
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
hostname | string | — | — |
cb | Callback<SRVRecord[]> | — | — |
resolveTlsa(hostname: string, cb: Callback<TLSARecord[]>): void
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
hostname | string | — | — |
cb | Callback<TLSARecord[]> | — | — |
resolveTxt(hostname: string, cb: Callback<string[][]>): void
Use the DNS protocol to resolve TXT records for hostname. The callback receives an array of
records, each itself an array of the strings that make up that record.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
hostname | string | — | The host name to query TXT records for. |
cb | Callback<string[][]> | — | Called with (err, records); each record is an array of the strings it is made of. |
reverse(ip: string, cb: Callback<string[]>): void
Resolves the pointer records for ip.
This queries the reverse zone for the address only. Unlike Node.js, the hosts file is not consulted first, so an address that is only named there does not resolve.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
ip | string | — | — |
cb | Callback<string[]> | — | — |
DNSResolver.setLocalAddress(ipv4?: string | null, ipv6?: string | null): void
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
ipv4? | string | null | — | — |
ipv6? | string | null | — | — |
DNSResolver.setServers(servers: string[]): void
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
servers | string[] | — | — |
DNSError
The module exports this class as dns.errors, which is the same class as require('bare-dns/errors').
DNSError.code: string
DNSError.INVALID_IP_ADDRESS(msg?: string): DNSError
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
msg? | string | — | — |
DNSError.query(status: number, syscall: string, hostname?: string | null): DNSError
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
status | number | — | — |
syscall | string | — | — |
hostname? | string | null | — | — |
DNSError.RESOLVER_DESTROYED(msg?: string): DNSError
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
msg? | string | — | — |
DNSError.UNKNOWN_RECORD_TYPE(msg?: string): DNSError
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
msg? | string | — | — |
DNSError.hostname: string
Present on errors created by DNSError.query() for a named host.
DNSError.name: 'DNSError'
DNSError.syscall: string
Present on errors created by DNSError.query().
Types
LookupOptions
interface LookupOptions {
family?: `IPv${IPFamily}` | IPFamily | 0
hints?: number
all?: boolean
}DNSResolverOptions
interface DNSResolverOptions {
servers?: string[]
localAddress?: { ipv4?: string; ipv6?: string }
}RecordWithTTL
interface RecordWithTTL {
address: string
ttl: number
}MXRecord
interface MXRecord {
priority: number
exchange: string
}SRVRecord
interface SRVRecord {
priority: number
weight: number
port: number
name: string
}NAPTRRecord
interface NAPTRRecord {
flags: string
service: string
regexp: string
replacement: string
order: number
preference: number
}SOARecord
interface SOARecord {
nsname: string
hostmaster: string
serial: number
refresh: number
retry: number
expire: number
minttl: number
}CAARecord
interface CAARecord {
critical: number
issue?: string
issuewild?: string
iodef?: string
contactemail?: string
contactphone?: string
}TLSARecord
interface TLSARecord {
certUsage: number
selector: number
match: number
data: Buffer
}bare-dns/promises
promises
promises.AnyRecord
type AnyRecord = | ({ type: 'A' } & RecordWithTTL)
| ({ type: 'AAAA' } & RecordWithTTL)
| { type: 'CNAME'; value: string }
| { type: 'NS'; value: string }
| { type: 'PTR'; value: string }
| { type: 'TXT'; entries: string[] }
| ({ type: 'MX' } & MXRecord)
| ({ type: 'SRV' } & SRVRecord)
| ({ type: 'NAPTR' } & NAPTRRecord)
| ({ type: 'SOA' } & SOARecord)promises.cancel(): void
promises.constants
promises.constants: {
readonly type: {
readonly A: 1
readonly NS: 2
readonly CNAME: 5
readonly SOA: 6
readonly PTR: 12
readonly HINFO: 13
readonly MX: 15
readonly TXT: 16
readonly SIG: 24
readonly AAAA: 28
readonly SRV: 33
readonly NAPTR: 35
readonly OPT: 41
readonly TLSA: 52
readonly SVCB: 64
readonly HTTPS: 65
readonly ANY: 255
readonly URI: 256
readonly CAA: 257
}
readonly status: Record<string, number>
}promises.getServers(): string[]
promises.lookup
promises.lookup(hostname: string, opts?: LookupOptions & { all?: false }): Promise<{ address: string; family: IPFamily | 0 }>Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
hostname | string | — | — |
opts? | LookupOptions & { all?: false } | — | — |
promises.resolve: DNSPromiseResolver['resolve']
promises.resolve4: DNSPromiseResolver['resolve4']
promises.resolve6: DNSPromiseResolver['resolve6']
promises.resolveAny: DNSPromiseResolver['resolveAny']
promises.resolveCaa: DNSPromiseResolver['resolveCaa']
promises.resolveCname: DNSPromiseResolver['resolveCname']
promises.resolveMx: DNSPromiseResolver['resolveMx']
promises.resolveNaptr: DNSPromiseResolver['resolveNaptr']
promises.resolveNs: DNSPromiseResolver['resolveNs']
promises.resolvePtr: DNSPromiseResolver['resolvePtr']
promises.resolveSoa: DNSPromiseResolver['resolveSoa']
promises.resolveSrv: DNSPromiseResolver['resolveSrv']
promises.resolveTlsa: DNSPromiseResolver['resolveTlsa']
promises.resolveTxt: DNSPromiseResolver['resolveTxt']
promises.reverse: DNSPromiseResolver['reverse']
promises.setLocalAddress(ipv4?: string | null, ipv6?: string | null): void
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
ipv4? | string | null | — | — |
ipv6? | string | null | — | — |
promises.setServers(servers: string[]): void
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
servers | string[] | — | — |
DNSPromiseResolver
The module exports this class as promises.Resolver, so create one with new promises.Resolver(). DNSPromiseResolver is its name in the type declarations, and promises.DNSPromiseResolver does not exist.
new DNSPromiseResolver(opts?: DNSResolverOptions)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
opts? | DNSResolverOptions | — | — |
promises.DNSPromiseResolver.cancel(): void
Aborts every query outstanding on this resolver. Each pending promise is
rejected with ECANCELLED.
promises.DNSPromiseResolver.destroy(): void
Cancels every query outstanding on this resolver, so that none is left without an answer, and releases the resources it holds. A query made after this rejects.
DNSPromiseResolver.global: DNSPromiseResolver
promises.DNSPromiseResolver.getServers(): string[]
resolve(hostname: string, rrtype?: 'A' | 'AAAA' | 'CNAME' | 'NS' | 'PTR'): Promise<string[]>
Overloads:
resolve(hostname: string, rrtype?: 'A' | 'AAAA' | 'CNAME' | 'NS' | 'PTR'): Promise<string[]>
resolve(hostname: string, rrtype: 'TXT'): Promise<string[][]>
resolve(hostname: string, rrtype: 'MX'): Promise<MXRecord[]>
resolve(hostname: string, rrtype: 'SRV'): Promise<SRVRecord[]>
resolve(hostname: string, rrtype: 'NAPTR'): Promise<NAPTRRecord[]>
resolve(hostname: string, rrtype: 'SOA'): Promise<SOARecord>
resolve(hostname: string, rrtype: 'CAA'): Promise<CAARecord[]>
resolve(hostname: string, rrtype: 'TLSA'): Promise<TLSARecord[]>
resolve(hostname: string, rrtype: 'ANY'): Promise<AnyRecord[]>Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
hostname | string | — | — |
rrtype? | 'A' | 'AAAA' | 'CNAME' | 'NS' | 'PTR' | — | — |
resolve4(hostname: string, opts?: { ttl?: false }): Promise<string[]>
Overloads:
resolve4(hostname: string, opts?: { ttl?: false }): Promise<string[]>
resolve4(hostname: string, opts: { ttl: true }): Promise<RecordWithTTL[]>Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
hostname | string | — | — |
opts? | { ttl?: false } | — | — |
resolve6(hostname: string, opts?: { ttl?: false }): Promise<string[]>
Overloads:
resolve6(hostname: string, opts?: { ttl?: false }): Promise<string[]>
resolve6(hostname: string, opts: { ttl: true }): Promise<RecordWithTTL[]>Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
hostname | string | — | — |
opts? | { ttl?: false } | — | — |
resolveAny(hostname: string): Promise<AnyRecord[]>
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
hostname | string | — | — |
resolveCaa(hostname: string): Promise<CAARecord[]>
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
hostname | string | — | — |
resolveCname(hostname: string): Promise<string[]>
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
hostname | string | — | — |
resolveMx(hostname: string): Promise<MXRecord[]>
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
hostname | string | — | — |
resolveNaptr(hostname: string): Promise<NAPTRRecord[]>
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
hostname | string | — | — |
resolveNs(hostname: string): Promise<string[]>
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
hostname | string | — | — |
resolvePtr(hostname: string): Promise<string[]>
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
hostname | string | — | — |
resolveSoa(hostname: string): Promise<SOARecord>
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
hostname | string | — | — |
resolveSrv(hostname: string): Promise<SRVRecord[]>
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
hostname | string | — | — |
resolveTlsa(hostname: string): Promise<TLSARecord[]>
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
hostname | string | — | — |
resolveTxt(hostname: string): Promise<string[][]>
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
hostname | string | — | — |
reverse(ip: string): Promise<string[]>
Resolves the pointer records for ip.
This queries the reverse zone for the address only. Unlike Node.js, the hosts file is not consulted first, so an address that is only named there does not resolve.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
ip | string | — | — |
promises.DNSPromiseResolver.setLocalAddress(ipv4?: string | null, ipv6?: string | null): void
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
ipv4? | string | null | — | — |
ipv6? | string | null | — | — |
promises.DNSPromiseResolver.setServers(servers: string[]): void
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
servers | string[] | — | — |
DNSError
promises.DNSError.code: string
promises.DNSError.INVALID_IP_ADDRESS(msg?: string): DNSError
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
msg? | string | — | — |
promises.DNSError.query(status: number, syscall: string, hostname?: string | null): DNSError
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
status | number | — | — |
syscall | string | — | — |
hostname? | string | null | — | — |
promises.DNSError.RESOLVER_DESTROYED(msg?: string): DNSError
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
msg? | string | — | — |
promises.DNSError.UNKNOWN_RECORD_TYPE(msg?: string): DNSError
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
msg? | string | — | — |
promises.DNSError.hostname: string
Present on errors created by DNSError.query() for a named host.
promises.DNSError.name: 'DNSError'
promises.DNSError.syscall: string
Present on errors created by DNSError.query().
Types
promises.RecordWithTTL
interface RecordWithTTL {
address: string
ttl: number
}promises.MXRecord
interface MXRecord {
priority: number
exchange: string
}promises.SRVRecord
interface SRVRecord {
priority: number
weight: number
port: number
name: string
}promises.NAPTRRecord
interface NAPTRRecord {
flags: string
service: string
regexp: string
replacement: string
order: number
preference: number
}promises.SOARecord
interface SOARecord {
nsname: string
hostmaster: string
serial: number
refresh: number
retry: number
expire: number
minttl: number
}promises.CAARecord
interface CAARecord {
critical: number
issue?: string
issuewild?: string
iodef?: string
contactemail?: string
contactphone?: string
}promises.TLSARecord
interface TLSARecord {
certUsage: number
selector: number
match: number
data: Buffer
}promises.LookupOptions
interface LookupOptions {
family?: `IPv${IPFamily}` | IPFamily | 0
hints?: number
all?: boolean
}promises.DNSResolverOptions
interface DNSResolverOptions {
servers?: string[]
localAddress?: { ipv4?: string; ipv6?: string }
}bare-dns/constants
Constants and variables
constants
constants: {
readonly type: {
readonly A: 1
readonly NS: 2
readonly CNAME: 5
readonly SOA: 6
readonly PTR: 12
readonly HINFO: 13
readonly MX: 15
readonly TXT: 16
readonly SIG: 24
readonly AAAA: 28
readonly SRV: 33
readonly NAPTR: 35
readonly OPT: 41
readonly TLSA: 52
readonly SVCB: 64
readonly HTTPS: 65
readonly ANY: 255
readonly URI: 256
readonly CAA: 257
}
readonly status: Record<string, number>
}bare-dns/errors
DNSError
require('bare-dns/errors') is the DNSError class itself, so its static methods are called as errors.query(), not errors.DNSError.query(). The headings below name them with the class prefix to match the type declarations.
errors.DNSError.code: string
errors.DNSError.INVALID_IP_ADDRESS(msg?: string): DNSError
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
msg? | string | — | — |
errors.DNSError.query(status: number, syscall: string, hostname?: string | null): DNSError
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
status | number | — | — |
syscall | string | — | — |
hostname? | string | null | — | — |
errors.DNSError.RESOLVER_DESTROYED(msg?: string): DNSError
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
msg? | string | — | — |
errors.DNSError.UNKNOWN_RECORD_TYPE(msg?: string): DNSError
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
msg? | string | — | — |
errors.DNSError.hostname: string
Present on errors created by DNSError.query() for a named host.
errors.DNSError.name: 'DNSError'
errors.DNSError.syscall: string
Present on errors created by DNSError.query().
See also
- Bare modules — the full
bare-*catalog. - Bare runtime API — the runtime these modules extend.
Last updated on