Rohit
Rohit

Reputation: 450

Why localhost is mapping to ipv6 ::1 and not to ipv4 127.0.0.1

I am developing an application in electronJS to run in Linux environment. It was working on old version of SLES15 SP4. When I upgraded the OS to SELES 15 SP5. I can see electron code is not able to call RES endpoint.

Description about issue:

NOTE: If you will comment line ::1 localhost ipv6-localhost ipv6-loopback in /etc/hosts file it will start working. But my requirement is to make it work with same content in /etc/hosts file.

Upvotes: 0

Views: 1942

Answers (1)

olh
olh

Reputation: 198

The default is to resolve "names" to their IPv6 address, instead of IPv4 addresses. I'm sure this is the default since a while already.

The way how the glibc resolver works can be controlled via /etc/gai.conf, see the gai.conf(5) man page for details.

Upvotes: 1

Related Questions