Packages

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

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DNS
  2. IResolver
  3. Object
  4. Any
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  9. def getServers(): Array[String]
    Definition Classes
    IResolver
  10. def hasOwnProperty(v: String): Boolean
    Definition Classes
    Object
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. def isPrototypeOf(v: Object): Boolean
    Definition Classes
    Object
  14. 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.

    Example:
    1. dns.lookup(hostname[, options], callback)

  15. 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.

    Example:
    1. dns.lookup(hostname[, options], callback)

  16. 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.

    Examples:
    1. dns.lookupService(address, port, callback)

    2. ,
    3. dns.lookupService('127.0.0.1', 22, (err, hostname, service) => { ... })

  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  20. def propertyIsEnumerable(v: String): Boolean
    Definition Classes
    Object
  21. def resolve(hostname: String, callback: DnsCallback1[Array[String]]): Unit
    Definition Classes
    IResolver
  22. def resolve(hostname: String, rrtype: RRType, callback: DnsCallback1[ResolveResult]): Unit
    Definition Classes
    IResolver
  23. def resolve4(hostname: String, callback: DnsCallback1[Array[String]]): Unit
    Definition Classes
    IResolver
  24. def resolve4(hostname: String, options: TtlOptions, callback: DnsCallback1[Array[String]]): Unit
    Definition Classes
    IResolver
  25. def resolve6(hostname: String, options: TtlOptions, callback: DnsCallback1[Array[String]]): Unit
    Definition Classes
    IResolver
  26. def resolve6(hostname: String, callback: DnsCallback1[Array[String]]): Unit
    Definition Classes
    IResolver
  27. def resolveAny(hostname: String, callback: DnsCallback1[Array[ResolveObject]]): Unit
    Definition Classes
    IResolver
  28. def resolveCname(hostname: String, callback: DnsCallback1[Array[String]]): Unit
    Definition Classes
    IResolver
  29. def resolveMx(hostname: String, callback: DnsCallback1[Array[MX]]): Unit
    Definition Classes
    IResolver
  30. def resolveNaptr(hostname: String, callback: DnsCallback1[Array[NAPTR]]): Unit
    Definition Classes
    IResolver
  31. def resolveNs(hostname: String, callback: DnsCallback1[Array[String]]): Unit
    Definition Classes
    IResolver
  32. def resolvePtr(hostname: String, callback: DnsCallback1[Array[String]]): Unit
    Definition Classes
    IResolver
  33. def resolveSoa(hostname: String, callback: DnsCallback1[Array[SOA]]): Unit
    Definition Classes
    IResolver
  34. def resolveSrv(hostname: String, callback: DnsCallback1[Array[SRV]]): Unit
    Definition Classes
    IResolver
  35. def resolveTxt(hostname: String, callback: DnsCallback1[Array[Array[String]]]): Unit
    Definition Classes
    IResolver
  36. def reverse(ipAddress: String, callback: DnsCallback1[Array[String]]): Unit
    Definition Classes
    IResolver
  37. def setServers(servers: Array[String]): Unit
    Definition Classes
    IResolver
  38. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  39. def toLocaleString(): String
    Definition Classes
    Object
  40. def toString(): String
    Definition Classes
    AnyRef → Any
  41. def valueOf(): Any
    Definition Classes
    Object
  42. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  43. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  44. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from IResolver

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped