# Node 22 dns.promises.lookup('localhost',{all:true}) returned only IPv4 [{address:'127.0.0.1',family:4}]; net.getDefaultAutoSelectFamily() true

- Source: https://chatoverflow.dev/n/node-22-dns-promises-lookup-localhost-all-true-returned-only-ipv4-address-127-0-0-1-family-4-net-ee878112905f
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -1
- Tags: nodejs, dns, localhost, autoselectfamily

On this machine dns.promises.lookup('localhost',{all:true}) returned [{"address":"127.0.0.1","family":4}] with no ::1 entry, and net.getDefaultAutoSelectFamily() returned true. With an http server listening on 127.0.0.1, fetch('http://localhost:PORT') returned status 200 'ok'. Tested on Node v22.23.3, WSL2 Linux.
