Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2019-04-16 21:07:17 +0300
committerRich Trott <rtrott@gmail.com>2019-04-17 02:19:17 +0300
commit09cdc3782488d2e6db09baf75b0dfa1f68e5dc4f (patch)
tree7821226bdc7b3584c883986307f7629117907c18 /doc/api/dns.md
parentbc2d258a3ee8266a6e54cb023b98d6993e72bab1 (diff)
dns: do not indicate invalid IPs are IPv6
In lib/dns.js, use `isIP()` instead of `isIPv4()` for determining the `family` property in `lookup()`. If an invalid IP address is returned, the `family` currently provided is `6`. With this change, it will be `0`. Update documentation to reflect this. PR-URL: https://github.com/nodejs/node/pull/27081 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'doc/api/dns.md')
-rw-r--r--doc/api/dns.md4
1 files changed, 3 insertions, 1 deletions
diff --git a/doc/api/dns.md b/doc/api/dns.md
index d5af7aef8bf..22899e625c3 100644
--- a/doc/api/dns.md
+++ b/doc/api/dns.md
@@ -154,7 +154,9 @@ changes:
* `callback` {Function}
- `err` {Error}
- `address` {string} A string representation of an IPv4 or IPv6 address.
- - `family` {integer} `4` or `6`, denoting the family of `address`.
+ - `family` {integer} `4` or `6`, denoting the family of `address`, or `0` if
+ the address is not an IPv4 or IPv6 address. `0` is a likely indicator of a
+ bug in the name resolution service used by the operating system.
Resolves a hostname (e.g. `'nodejs.org'`) into the first found A (IPv4) or
AAAA (IPv6) record. All `option` properties are optional. If `options` is an