From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | "Peter J(dot) Holzer" <hjp-pgsql(at)hjp(dot)at> |
Cc: | pgsql-general(at)lists(dot)postgresql(dot)org, Jerry LeVan <jerry(dot)levan(at)gmail(dot)com> |
Subject: | Re: Psql wants to use IP6 when connecting to self using tcp... |
Date: | 2021-06-24 20:26:28 |
Message-ID: | 2685746.1624566388@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
"Peter J. Holzer" <hjp-pgsql(at)hjp(dot)at> writes:
> On 2021-06-23 20:33:33 -0400, Tom Lane wrote:
>> It's quite odd that nslookup isn't agreeing with glibc's name
>> resolution code.
> AFAIK nslookup uses only DNS. Glibc uses all methods in nsswitch.conf.
Ah, right. So looking at a Fedora 34 installation, I see in
/etc/nsswitch.conf:
...
hosts: files myhostname resolve [!UNAVAIL=return] dns
...
/etc/hosts is pretty innocuous:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
On the other hand, "man nss-myhostname" says
o The local, configured hostname is resolved to all locally
configured IP addresses ordered by their scope, or -- if none are
configured -- the IPv4 address 127.0.0.2 (which is on the local
loopback) and the IPv6 address ::1 (which is the local host).
so it might be that that's what is causing the weird behavior.
On this machine, with a recent PG build installed but no running
server, I see:
$ psql -h rpi3
psql: error: connection to server at "rpi3" (fe80::ba27:ebff:fe51:3b34), port 5432 failed: Connection refused
Is the server running on that host and accepting TCP/IP connections?
connection to server at "rpi3" (192.168.1.61), port 5432 failed: Connection refused
Is the server running on that host and accepting TCP/IP connections?
so indeed *something* is injecting an IPv6 address that I didn't
ask for. However, I see the same two addresses probed with the
fully-qualified machine name, so it's not quite like Jerry's result.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Bhavesh Mistry | 2021-06-24 21:33:03 | Ubuntu 14.04 (trusty) Postgres 13 deb package |
Previous Message | Peter J. Holzer | 2021-06-24 15:42:27 | Re: Psql wants to use IP6 when connecting to self using tcp... |