Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lwDJQ-0004WZ-69 for pgsql-general@arkaria.postgresql.org; Thu, 24 Jun 2021 00:33:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lwDJP-0001wG-5i for pgsql-general@arkaria.postgresql.org; Thu, 24 Jun 2021 00:33:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lwDJO-0001w8-T4 for pgsql-general@lists.postgresql.org; Thu, 24 Jun 2021 00:33:42 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lwDJM-0005hI-8T for pgsql-general@lists.postgresql.org; Thu, 24 Jun 2021 00:33:42 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 15O0XXG02558212; Wed, 23 Jun 2021 20:33:33 -0400 From: Tom Lane To: Jerry LeVan cc: "Peter J. Holzer" , pgsql-general@lists.postgresql.org Subject: Re: Psql wants to use IP6 when connecting to self using tcp... In-reply-to: References: <20210623175127.GB27765@hjp.at> Comments: In-reply-to Jerry LeVan message dated "Wed, 23 Jun 2021 17:25:57 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2558210.1624494813.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 23 Jun 2021 20:33:33 -0400 Message-ID: <2558211.1624494813@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Jerry LeVan writes: > bigbox has a freshly installed Fedora 34 system and it runs postgresql 1= 3.3 > the following are being run ON bigbox > nslookup bigbox returns the correct ipv4 address > nslookup bigbox.skynet returns the correct ipv4 address > psql -h bigbox.skynet allows me to connect to the database > psql -h bigbox fails because the ipv6 address is returned and there is = no hba entry.. It's quite odd that nslookup isn't agreeing with glibc's name resolution code. I suspect that the problem lies with systemd, which has relentlessly continued its campaign to break everything in sight, and has lately gotten its fingers into name resolution as well: https://fedoraproject.org/wiki/Changes/systemd-resolved Perhaps something on that page will help you figure out what's up. My guess based on what you've said here is that nslookup and glibc are not using the same DNS search path. Traditionally that would be set by a "search" line in /etc/resolv.conf, but ghod knows how it's determined under systemd-resolved. regards, tom lane