DNS

Domain Name System (DNS) APIs

Although named for the Domain Name System (DNS), it does not always use the DNS protocol for lookups. This module uses the operating system facilities to perform name resolution. It may not need to perform any network communication.

Members

(static, constant) IP_ADDRESS_V4 :RegExp

A regular expression that matches IPv4 addresses.

Source:
Type:
  • RegExp

(static, constant) IP_ADDRESS_V6 :RegExp

A regular expression that matches IPv6 addresses.

Source:
Type:
  • RegExp

Methods

(static) lookup(hostname) → {Promise.<Array.<Resolution>>}

Resolves a host name into the first found A (IPv4) or AAAA (IPv6) record.

Source:
Parameters:
Name Type Description
hostname String

Host name to resolve.

Returns:
Type:
Promise.<Array.<Resolution>>

An array of resolved hostnames.

Type Definitions

Resolution

Properties:
Name Type Description
address string

A string representation of an IP address.

family string

Denoting the family of the address (IPv4 or IPv6).

Source:
Type:
  • Object