Skip to content
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

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

Closed
treysis opened this issue Mar 27, 2021 · 2 comments

Comments

@treysis
Copy link

treysis commented Mar 27, 2021

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.

@sjorge
Copy link
Contributor

sjorge commented Mar 28, 2021

Might be hitting https://www.illumos.org/issues/7494 or a similar issue.
Python still doesn't do the right thing for saltstack to this day.

@treysis
Copy link
Author

treysis commented Mar 28, 2021

Turned out this is normal behavior due to calling getaddrinfo() with AI_ADDRCONFIG when doing lookups.

@treysis treysis closed this as completed Mar 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants