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 1mJcPh-0001QO-DL for pgsql-general@arkaria.postgresql.org; Fri, 27 Aug 2021 14:00:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mJcPg-0003JV-CN for pgsql-general@arkaria.postgresql.org; Fri, 27 Aug 2021 14:00:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mJcPg-0003JL-3V for pgsql-general@lists.postgresql.org; Fri, 27 Aug 2021 14:00:56 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mJcPe-0000uq-6r for pgsql-general@lists.postgresql.org; Fri, 27 Aug 2021 14:00:55 +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 17RE0qhP748473; Fri, 27 Aug 2021 10:00:52 -0400 From: Tom Lane To: Mike Martin cc: pgsql-general@lists.postgresql.org Subject: Re: Problem with connecting with named host parameter In-reply-to: References: Comments: In-reply-to Mike Martin message dated "Fri, 27 Aug 2021 14:29:47 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <748471.1630072852.1@sss.pgh.pa.us> Date: Fri, 27 Aug 2021 10:00:52 -0400 Message-ID: <748472.1630072852@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Mike Martin writes: > I am getting the following error when I connect with hostname on localhost > psql -h capture -U -p 5432 > psql: error: FATAL: no pg_hba.conf entry for host > "fe80::7285:c2ff:feb0:cd4%eth0", user "usevideo", database "usevideos", SSL > off Evidently, your DNS setup is resolving the machine's name as a IPv6 address, whereupon PG quite legitimately doesn't find a match in its pg_hba table. (I suppose you are using listen_addresses = "*", else the server wouldn't even be listening on this address.) > This is with pg 11 and 12 on fedora 34 Looking at the "hosts" entry in /etc/nsswitch.conf might help figure out exactly what's going on, but I'll bet a nickel that this is some unhelpful systemd behavior. regards, tom lane