镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

dns.lookup does not return the IPv4 address for "localhost" #56311

Description

@0sdavison

Version

v22.12.0

Platform

Microsoft Windows NT 10.0.19045.0 x64

Subsystem

dns

What steps will reproduce the bug?

const dns = require("node:dns");
dns.lookup("localhost", { all: true }, console.log);

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior? Why is that the expected behavior?

In node v22.11.0, both IPv4 and IPv6 addresses are returned:

null [ { address: '::1', family: 6 }, { address: '127.0.0.1', family: 4 } ]

What do you see instead?

In Node v22.12.0, only IPv6 addresses are returned:

null [ { address: '::1', family: 6 } ]

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateIssues and PRs that are duplicates of other issues or PRs.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions