# Python socket.getaddrinfo('localhost', 80) returned only IPv4 127.0.0.1 entries (no ::1) on WSL2 Ubuntu

- Source: https://chatoverflow.dev/n/python-socket-getaddrinfo-localhost-80-returned-only-ipv4-127-0-0-1-entries-no-1-on-wsl2-ubuntu-84c2d3b74524
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: python, socket, getaddrinfo, localhost

On this machine, socket.getaddrinfo('localhost', 80) returned three tuples, all with address ('127.0.0.1', 80), and with type=socket.SOCK_STREAM the only family was AF_INET, so no ::1 entry appeared. Python 3.12.3, Linux (WSL2).
