Skip to content

dns: support IPv6-only and IPv4-only in setLocalAddress() #60802

dns: support IPv6-only and IPv4-only in setLocalAddress()

dns: support IPv6-only and IPv4-only in setLocalAddress() #60802

Triggered via pull request September 26, 2026 20:04
@panvapanva
reopened #58701
Status Failure
Total duration 32s
Artifacts –

commit-lint.yml

on: pull_request_target
lint-commit-message
29s
lint-commit-message
Fit to window
Zoom out
Zoom in

Annotations

1 error and 1 warning
lint-commit-message
# a163c21f43ac5dfdc10479002974465318116cb4 ok 1 assisted-by-is-trailer: no Assisted-by metadata ok 2 co-authored-by-is-trailer: no Co-authored-by metadata ok 3 fixes-url: skipping fixes-url # SKIP ok 4 line-after-title: blank line after title not ok 5 line-length: Line should be <= 72 columns. --- { found: 82, compare: '<=', wanted: 72, at: { line: 2, column: 72, body: [ '', '## Title', 'dns: allow `resolver.setLocalAddress()` to accept IPv6-only or IPv4-only addresses', '', '## Description', '`ResolverBase.prototype.setLocalAddress()` previously **required** the first argument (`ipv4`) to be a non-empty string, throwing `ERR_INVALID_ARG_TYPE` whenever a user tried to set **only** an IPv6 local address:', '', '```js', "const r = new (require('dns').Resolver)();", "r.setLocalAddress(undefined, '::1'); // ❌ TypeError", '', 'This broke documented API behaviour and prevented IPv6-only configurations.', '', 'Changes', 'lib/internal/dns/utils.js', 'Imported ERR_MISSING_ARGS.', 'Updated', 'setLocalAddress()', ':', "If both ipv4 and ipv6 are undefined, throw ERR_MISSING_ARGS('ipv4', 'ipv6').", 'Validate each address only when provided.', 'Preserve snapshot-state logic.', 'Result', 'setLocalAddress()', ' now works correctly with any of:', '', "resolver.setLocalAddress('0.0.0.0'); // IPv4-only", "resolver.setLocalAddress(undefined, '::1'); // IPv6-only", "resolver.setLocalAddress('0.0.0.0', '::1'); // both", '', 'Restores compliance with public documentation and unblocks IPv6-only deployments.' ] } } ... not ok 6 line-length: Line should be <= 72 columns. --- { found: 213, compare: '<=', wanted: 72, at: { line: 5, column: 72, body: [ '', '## Title', 'dns: allow `resolver.setLocalAddress()` to accept IPv6-only or IPv4-only addresses', '', '## Description', '`ResolverBase.prototype.setLocalAddress()` previously **required** the first argument (`ipv4`) to be a non-empty string, throwing `ERR_INVALID_ARG_TYPE` whenever a user tried to set **only** an IPv6 local address:', '', '```js', "const r = new (require('dns').Resolver)();", "r.setLocalAddress(undefined, '::1'); // ❌ TypeError", '', 'This broke documented API behaviour and prevented IPv6-only configurations.', '', 'Changes', 'lib/internal/dns/utils.js', 'Imported ERR_MISSING_ARGS.', 'Updated', 'setLocalAddress()', ':', "If both ipv4 and ipv6 are undefined, throw ERR_MISSING_ARGS('ipv4', 'ipv6').", 'Validate each address only when provided.', 'Preserve snapshot-state logic.', 'Result', 'setLocalAddress()', ' now works correctly with any of:', '', "resolver.setLocalAddress('0.0.0.0'); // IPv4-only", "resolver.setLocalAddress(undefined, '::1'); // IPv6-only", "resolver.setLocalAddress('0.0.0.0', '::1'); // both", '', 'Restores compliance with public documentation and unblocks IPv6-only deployments.' ] } } ... not ok 7 line-length: Line should be <= 72 columns. --- { found: 75, compare: '<=', wanted: 72, at: { line: 11, column: 72, body: [ '', '## Title', 'dns: allow `resolver.setLocalAddress()` to accept IPv6-only or IPv4-only addresses', '', '## Description', '`ResolverBase.prototype.setLocalAddress()` previously **required** the first argument (`ipv4`) to be a non-empty string, throwing `ERR_INVALID_ARG_TYPE` wh
Workflow execution policy warning (evaluate mode): .github/workflows/commit-lint.yml#L1
On November 2, 2026, GitHub will restrict `pull_request_target` on public repositories by default. To continue allowing the event trigger, configure an Actions policy. Learn more: https://gh.io/securely-using-pull_request_target#default-policy-for-pull_request_target