From 4af0edfe1332d2c4d7924a331935fb7816b00581 Mon Sep 17 00:00:00 2001 From: galaxy4276 Date: Sat, 18 Apr 2026 21:16:56 +0900 Subject: [PATCH] doc: clarify dns.lookup() callback signature when all is true Document the `addresses` argument returned by the callback when `options.all` is true, and note that `address` and `family` are not provided in that case. Fixes #57355 Co-Authored-By: Claude Sonnet 4.6 --- doc/api/dns.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/api/dns.md b/doc/api/dns.md index b2e350bfc6caa6..6ee87e2673f998 100644 --- a/doc/api/dns.md +++ b/doc/api/dns.md @@ -277,9 +277,15 @@ changes: * `callback` {Function} * `err` {Error} * `address` {string} A string representation of an IPv4 or IPv6 address. + Not provided when `options.all` is `true`. * `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. + Not provided when `options.all` is `true`. + * `addresses` {Object\[]} An array of address objects when `options.all` is + `true`. Each object has the following properties: + * `address` {string} A string representation of an IPv4 or IPv6 address. + * `family` {integer} `4` or `6`, denoting the family of `address`. Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or AAAA (IPv6) record. All `option` properties are optional. If `options` is an