Skip to content

localhost doesn't resolve to ::1, despite having the correct entry in /etc/hosts #982

@treysis

Description

@treysis

I cannot connect/ping localhost to resolve to IPv6 ::1 if there is no other IPv6 configured.

I made sure that /etc/hosts reads ::1 localhost, I also made sure that ifconfig shows ::1 for the lo interface. But ping or connect will not resolve, even if I force address family via -A inet6. It only works after I set another IPv6 address.

Why can't I connect to ::1? This also causes problems with the NodeJS testing suite: nodejs/node#37931

Unless I disable IPv6 in kernel, connecting to ::1 or localhost resolving to ::1 should work just fine. It does on Linux and Windows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions