trait DNS extends Object with IResolver
The dns module contains functions belonging to two different categories: 1) Functions that use the underlying operating system facilities to perform name resolution, and that do not necessarily perform any network communication. This category contains only one function: dns.lookup(). Developers looking to perform name resolution in the same way that other applications on the same operating system behave should use dns.lookup().
- Annotations
- @RawJSType() @native()
- See also
https://nodejs.org/api/dns.html
- Alphabetic
- By Inheritance
- DNS
- IResolver
- Object
- Any
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def getServers(): Array[String]
- Definition Classes
- IResolver
- def hasOwnProperty(v: String): Boolean
- Definition Classes
- Object
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isPrototypeOf(v: Object): Boolean
- Definition Classes
- Object
- def lookup(hostname: String, callback: DnsCallback1[String]): Unit
Resolves a hostname (e.g.
Resolves a hostname (e.g. 'nodejs.org') into the first found A (IPv4) or AAAA (IPv6) record. options can be an object or integer. If options is not provided, then IPv4 and IPv6 addresses are both valid. If options is an integer, then it must be 4 or 6.
Alternatively, options can be an object containing these properties:
- family <Number> - The record family. If present, must be the integer 4 or 6. If not provided, both IP v4 and v6 addresses are accepted.
- hints: <Number> - If present, it should be one or more of the supported getaddrinfo flags. If hints is not provided, then no flags are passed to getaddrinfo. Multiple flags can be passed through hints by logically ORing their values. See supported getaddrinfo flags for more information on supported flags.
- all: <Boolean> - When true, the callback returns all resolved addresses in an array, otherwise returns a single address. Defaults to false.
All properties are optional.
dns.lookup(hostname[, options], callback)
Example: - def lookup(hostname: String, options: |[DnsOptions, Int], callback: DnsCallback2[String, Int]): Unit
Resolves a hostname (e.g.
Resolves a hostname (e.g. 'nodejs.org') into the first found A (IPv4) or AAAA (IPv6) record. options can be an object or integer. If options is not provided, then IPv4 and IPv6 addresses are both valid. If options is an integer, then it must be 4 or 6.
Alternatively, options can be an object containing these properties:
- family <Number> - The record family. If present, must be the integer 4 or 6. If not provided, both IP v4 and v6 addresses are accepted.
- hints: <Number> - If present, it should be one or more of the supported getaddrinfo flags. If hints is not provided, then no flags are passed to getaddrinfo. Multiple flags can be passed through hints by logically ORing their values. See supported getaddrinfo flags for more information on supported flags.
- all: <Boolean> - When true, the callback returns all resolved addresses in an array, otherwise returns a single address. Defaults to false.
All properties are optional.
dns.lookup(hostname[, options], callback)
Example: - def lookupService(address: String, port: Int, callback: DnsCallback2[String, String]): Unit
Resolves the given address and port into a hostname and service using the operating system's underlying getnameinfo implementation.
Resolves the given address and port into a hostname and service using the operating system's underlying getnameinfo implementation.
If address is not a valid IP address, a TypeError will be thrown. The port will be coerced to a number. If it is not a legal port, a TypeError will be thrown.
The callback has arguments (err, hostname, service). The hostname and service arguments are strings (e.g. 'localhost' and 'http' respectively).
On error, err is an Error object, where err.code is the error code.
dns.lookupService(address, port, callback)
, dns.lookupService('127.0.0.1', 22, (err, hostname, service) => { ... })
Examples: - final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def propertyIsEnumerable(v: String): Boolean
- Definition Classes
- Object
- def resolve(hostname: String, callback: DnsCallback1[Array[String]]): Unit
- Definition Classes
- IResolver
- def resolve(hostname: String, rrtype: RRType, callback: DnsCallback1[ResolveResult]): Unit
- Definition Classes
- IResolver
- def resolve4(hostname: String, callback: DnsCallback1[Array[String]]): Unit
- Definition Classes
- IResolver
- def resolve4(hostname: String, options: TtlOptions, callback: DnsCallback1[Array[String]]): Unit
- Definition Classes
- IResolver
- def resolve6(hostname: String, options: TtlOptions, callback: DnsCallback1[Array[String]]): Unit
- Definition Classes
- IResolver
- def resolve6(hostname: String, callback: DnsCallback1[Array[String]]): Unit
- Definition Classes
- IResolver
- def resolveAny(hostname: String, callback: DnsCallback1[Array[ResolveObject]]): Unit
- Definition Classes
- IResolver
- def resolveCname(hostname: String, callback: DnsCallback1[Array[String]]): Unit
- Definition Classes
- IResolver
- def resolveMx(hostname: String, callback: DnsCallback1[Array[MX]]): Unit
- Definition Classes
- IResolver
- def resolveNaptr(hostname: String, callback: DnsCallback1[Array[NAPTR]]): Unit
- Definition Classes
- IResolver
- def resolveNs(hostname: String, callback: DnsCallback1[Array[String]]): Unit
- Definition Classes
- IResolver
- def resolvePtr(hostname: String, callback: DnsCallback1[Array[String]]): Unit
- Definition Classes
- IResolver
- def resolveSoa(hostname: String, callback: DnsCallback1[Array[SOA]]): Unit
- Definition Classes
- IResolver
- def resolveSrv(hostname: String, callback: DnsCallback1[Array[SRV]]): Unit
- Definition Classes
- IResolver
- def resolveTxt(hostname: String, callback: DnsCallback1[Array[Array[String]]]): Unit
- Definition Classes
- IResolver
- def reverse(ipAddress: String, callback: DnsCallback1[Array[String]]): Unit
- Definition Classes
- IResolver
- def setServers(servers: Array[String]): Unit
- Definition Classes
- IResolver
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toLocaleString(): String
- Definition Classes
- Object
- def toString(): String
- Definition Classes
- AnyRef → Any
- def valueOf(): Any
- Definition Classes
- Object
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])