Skip to content

doc: mark Resolver.setLocalAddress ipv4 as required - #65190

Closed
arhxam wants to merge 1 commit into
nodejs:mainfrom
arhxam:doc-dns-set-local-address-ipv4
Closed

doc: mark Resolver.setLocalAddress ipv4 as required#65190
arhxam wants to merge 1 commit into
nodejs:mainfrom
arhxam:doc-dns-set-local-address-ipv4

Conversation

@arhxam

@arhxam arhxam commented Aug 10, 2026

Copy link
Copy Markdown

Description

Resolver#setLocalAddress() documents ipv4 as optional with a default of
'0.0.0.0'. The implementation unconditionally validates ipv4 as a string,
so omitting it throws ERR_INVALID_ARG_TYPE; only ipv6 is optional.

> new Resolver().setLocalAddress()
TypeError [ERR_INVALID_ARG_TYPE]: The "ipv4" argument must be of type string.
Received undefined

This marks ipv4 as required, removes its nonexistent default, and clarifies
that the operating system chooses the IPv6 local address when ipv6 is
omitted. Documentation-only change.

The implementation unconditionally validates ipv4 as a string, so
omitting it throws ERR_INVALID_ARG_TYPE. Only ipv6 is optional. Update
the signature, parameter default, and explanatory text to match.

Signed-off-by: Arham Wani <arhamwani765@gmail.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 Aug 10, 2026
@aduh95 aduh95 closed this Aug 10, 2026
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.

3 participants