Path: ...!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Carlos E. R." Newsgroups: comp.os.linux.misc Subject: Re: Linux advocacy Date: Tue, 20 May 2025 11:46:44 +0200 Lines: 63 Message-ID: References: <100c46e$3c1el$1@news1.tnib.de> <100hcra$3nsq7$1@news1.tnib.de> <100hetv$24um2$2@dont-email.me> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net yzAYiOAcO2PkGUJzxf2wbQHt2k1cElM4XqLSxpjLUqfqjiFUmX Cancel-Lock: sha1:HklYdQnLE/WWzQZnNfd6cMB0+KQ= sha256:nr2WSVxjF8AxB4yyiOdEi/wTmGzkB/hTRU8CRxxeWco= User-Agent: Mozilla Thunderbird Content-Language: en-CA, es-ANY In-Reply-To: <100hetv$24um2$2@dont-email.me> Bytes: 2762 On 2025-05-20 10:36, Nuno Silva wrote: > On 2025-05-20, Marc Haber wrote: > > Maybe what's missing here for some of the affected people is configuring > address lookup to prefer IPv4 if they're using nameservers that return > AAAA records? > > (Just a wild guess, but fitting enough that it's probably a good idea to > drop this here:) > > news://news.gmane.io/m3msju6x5x.fsf@lugabout.jhcloos.org > > Although I'm not sure, from the gai.conf online manual page, that just > the mentioned line is sufficient, given it's said to disable the > "default table". I didn't test this myself. I knew and did the trick in the past, but I have forgotten, so I asked chatgpt: Method 1: Edit /etc/gai.conf to prefer IPv4 The /etc/gai.conf file is used by the GNU C Library (glibc) to influence address selection when a hostname resolves to multiple addresses (e.g., both A and AAAA records). Open the file in a text editor as root: sudo nano /etc/gai.conf Find the following line (it’s usually commented out): #precedence ::ffff:0:0/96 100 Uncomment the line by removing the #: precedence ::ffff:0:0/96 100 This tells the system to prefer IPv4-mapped addresses over IPv6. Save and exit the editor. This change takes effect immediately for new processes that use glibc’s getaddrinfo() function. Method 2: Disable IPv6 (not recommended unless necessary) (skip) Verify Preference You can test the preference with getent: getent ahosts example.com The top address should be IPv4 if the change worked. -- Cheers, Carlos E.R.