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.
- Source:
- See:
Members
(static, constant) IP_ADDRESS_V4 :RegExp
A regular expression that matches IPv4 addresses.
Type:
-
RegExp
(static, constant) IP_ADDRESS_V6 :RegExp
A regular expression that matches IPv6 addresses.
Type:
-
RegExp
Methods
(static) lookup(hostname) → {Promise.<Array.<Resolution>>}
Resolves a host name into the first found A (IPv4) or AAAA (IPv6) record.
Parameters:
Name | Type | Description |
---|---|---|
hostname |
String
|
Host name to resolve. |
Returns:
- Type:
-
Promise.<Array.<Resolution>>
An array of resolved hostnames.