Skip to content

Commit 4af0edf

Browse files
galaxy4276claude
andcommitted
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 <noreply@anthropic.com>
1 parent 31b9e60 commit 4af0edf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

doc/api/dns.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,15 @@ changes:
277277
* `callback` {Function}
278278
* `err` {Error}
279279
* `address` {string} A string representation of an IPv4 or IPv6 address.
280+
Not provided when `options.all` is `true`.
280281
* `family` {integer} `4` or `6`, denoting the family of `address`, or `0` if
281282
the address is not an IPv4 or IPv6 address. `0` is a likely indicator of a
282283
bug in the name resolution service used by the operating system.
284+
Not provided when `options.all` is `true`.
285+
* `addresses` {Object\[]} An array of address objects when `options.all` is
286+
`true`. Each object has the following properties:
287+
* `address` {string} A string representation of an IPv4 or IPv6 address.
288+
* `family` {integer} `4` or `6`, denoting the family of `address`.
283289

284290
Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or
285291
AAAA (IPv6) record. All `option` properties are optional. If `options` is an

0 commit comments

Comments
 (0)