Skip to content

doc: clarify dns.lookup() callback signature when all is true#62800

Merged
nodejs-github-bot merged 1 commit intonodejs:mainfrom
galaxy4276:doc/dns-lookup-callback-addresses
Apr 20, 2026
Merged

doc: clarify dns.lookup() callback signature when all is true#62800
nodejs-github-bot merged 1 commit intonodejs:mainfrom
galaxy4276:doc/dns-lookup-callback-addresses

Conversation

@galaxy4276
Copy link
Copy Markdown
Contributor

@galaxy4276 galaxy4276 commented Apr 18, 2026

Summary

The callback parameter block for dns.lookup() only documented the default signature (err, address, family). When options.all is set to true, the callback signature changes to (err, addresses), but the addresses argument was absent from the structured parameter documentation.
it was only mentioned in prose below.

Changes

  • Add addresses {Object[]} to the callback parameter block, describing
    the array of { address, family } objects returned when options.all
    is true
  • Add "Not provided when options.all is true" notes to address and
    family parameters to make the two code paths explicit

Fixes: #57355

Test plan

  • Documentation change only — no runtime behavior affected
  • make lint-md passes

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 nodejs#57355

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/net

@nodejs-github-bot nodejs-github-bot added dns Issues and PRs related to the dns subsystem. doc Issues and PRs related to the documentations. labels Apr 18, 2026
Copy link
Copy Markdown
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Copy Markdown
Member

@pimterry pimterry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, thanks @galaxy4276!

@pimterry pimterry added the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 20, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 20, 2026
@nodejs-github-bot nodejs-github-bot merged commit 5e0bcab into nodejs:main Apr 20, 2026
28 checks passed
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Landed in 5e0bcab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dns Issues and PRs related to the dns subsystem. doc Issues and PRs related to the documentations.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dns.lookup signature out of date

4 participants