Re: Problem with connecting with named host parameter

From: Mike Martin <redtux1(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Problem with connecting with named host parameter
Date: 2021-08-27 16:02:39
Message-ID: CAOwYNKZr42naH2dXChRu_6W53_vsV0TX-JCdF8ZNrpoAZiw=8w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 27 Aug 2021 at 15:00, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Mike Martin <redtux1(at)gmail(dot)com> writes:
> > I am getting the following error when I connect with hostname on
> localhost
>
> > psql -h capture -U <dbuser> -p 5432 <dbname>
> > 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
>

Very possibly.

I seem to have resolved the issue with just the following active lines in
pg_hba.conf

host all all samehost password
host all all samenet password

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2021-08-27 16:29:38 Re: pg_dump - increase in backup time - log
Previous Message Adrian Klaver 2021-08-27 15:59:53 Re: pg_dump - increase in backup time - log