Mailinglist Archive: opensuse-factory (355 mails)

< Previous Next >
Re: [opensuse-factory] getent hosts localhost -> ::1
On Fri, 6 Mar 2020 15:03, Michael Ströder <michael@...> wrote:

HI!

After upgrade to Tumbleweed 20200304 host name localhost insists on IPv6
address no matter what's in /etc/hosts:

# getent hosts localhost
::1 localhost

Relevant lines from /etc/hosts attached below.

How can I disable that without completely switching off IPv6?

Ciao, Michael.

The magic you are looking for happens in {/,/usr/}etc/gai.conf
see man page "man 5 gai.conf" - it comes with the glibc package

relevant part of gai.conf:
<snip before>
# precedence <mask> <value>
# Add another rule to the RFC 3484 precedence table. See section 2.1
# and 10.3 in RFC 3484. The default is:
#
<snip>
#precedence ::ffff:0:0/96 10
#
# For sites which prefer IPv4 connections change the last line to
#
precedence ::ffff:0:0/96 100
<snip after>

if you just want to modify localhost use a more limiting selector:
precedence ::ffff:127.0.0.0/104 100

Have a nice weekend,
- Yamaban
< Previous Next >
Follow Ups
References