Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
0sdavison opened this issue Dec 18, 2024 · 1 comment
Closed

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

0sdavison opened this issue Dec 18, 2024 · 1 comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs.

Comments

@0sdavison
Copy link

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

@richardlau
Copy link
Member

Duplicate of #56137

@richardlau richardlau marked this as a duplicate of #56137 Dec 18, 2024
@jakecastelli jakecastelli added the duplicate Issues and PRs that are duplicates of other issues or PRs. label Dec 19, 2024
@targos targos closed this as completed Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs.
Projects
None yet
Development

No branches or pull requests

5 participants
@targos @richardlau @0sdavison @jakecastelli and others