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 1lwBJs-0000G8-Co for pgsql-general@arkaria.postgresql.org; Wed, 23 Jun 2021 22:26:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lwBJq-00061q-9j for pgsql-general@arkaria.postgresql.org; Wed, 23 Jun 2021 22:26:02 +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 1lwBJp-00061i-Uz for pgsql-general@lists.postgresql.org; Wed, 23 Jun 2021 22:26:02 +0000 Received: from mail-qk1-x731.google.com ([2607:f8b0:4864:20::731]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lwBJn-00030q-NR for pgsql-general@lists.postgresql.org; Wed, 23 Jun 2021 22:26:00 +0000 Received: by mail-qk1-x731.google.com with SMTP id c138so9373478qkg.5 for ; Wed, 23 Jun 2021 15:25:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:content-transfer-encoding:mime-version:subject:date:references :to:in-reply-to:message-id; bh=KuXpWuWLE1r/tKaCyzSKk3jN5LdIQmAnTpKp9bsuQUw=; b=MKO6HzXuvr1NSTeyk2pMe1ceb9okuhLG1Yj53YgV6t9vhZE6wp6nQnlRDENeIFBWe6 SdSNyc3ing1JdypCluJbJajtpg2Ypt0CGI7SoL9E8lha2jqGcyzxPzjn/QqN8+jqgMeO iwXM5gYq3wQR9nEjT8y6vU/ZarhuFsPtRD4zO6lRuuizfoX3sZIoKwPS9bPPI1zSXvxD LmTB5BYIesgjMzeS2PMBuEXDtIDW/KK9+p97AHqLOlf6kx4nVTo+5ghuK2WafgLF8lYn tszyWdLDfP4AGPgvweJER3LFYuN0h8i4TthGXueje/z7lcWjjbnZM4Wl0vPrXe75rj3r YLkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:date:references:to:in-reply-to:message-id; bh=KuXpWuWLE1r/tKaCyzSKk3jN5LdIQmAnTpKp9bsuQUw=; b=FWXacCzskTsF/Ba3AQ1bD1O9ssl++JGrM5B7v+K7jNsgNAEDROIt8q4QP+7wA9uxqo ml1NHTYMh2eR+ATSRo2n+ENCWhY4sT/C67PBE/WS5RDUisTCcqEUD6Q2kgc3+EtcDprU fjPUauPpHhYd2r9bv/yhgSMAmATaI1U6qxAZcXaG86duX76MTB3n+USZerdPZVrS4Abo kS1jpb+iXIu7j9UgGrNX+/6BZJ1XlP93Pv+C0OZ2fV2qs+uBX/bYMvEnhnAgzOCjKvv4 t7k5U9IJ5oFxnSgnUTsqQa8LI0bLhGwMBF2hGuGF5NaklqV8DCQxSRfYms7WaBd+F6HZ 7V8w== X-Gm-Message-State: AOAM530skSE0IJtg9w8c64+6I/PxQ1adNhIhJrrjRQX24BJ/TYrD7il5 eI/diPahHInwqrkP44NXfIMb9IIo6Lw= X-Google-Smtp-Source: ABdhPJz9yBVMu1MMcN868xbdcGmikwvXCEk+pxBl3CqCxiaLLKOTQHICTKRB1YEZXWmn48ufVe1M3w== X-Received: by 2002:a05:620a:4045:: with SMTP id i5mr2463269qko.310.1624487158848; Wed, 23 Jun 2021 15:25:58 -0700 (PDT) Received: from smtpclient.apple ([104.62.247.40]) by smtp.gmail.com with ESMTPSA id l6sm977838qkk.117.2021.06.23.15.25.58 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jun 2021 15:25:58 -0700 (PDT) From: Jerry LeVan Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Subject: Re: Psql wants to use IP6 when connecting to self using tcp... Date: Wed, 23 Jun 2021 17:25:57 -0500 References: <20210623175127.GB27765@hjp.at> To: "Peter J. Holzer" , pgsql-general@lists.postgresql.org In-Reply-To: <20210623175127.GB27765@hjp.at> Message-Id: X-Mailer: Apple Mail (2.3654.100.0.2.22) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Jun 23, 2021, at 12:51 PM, Peter J. Holzer = wrote: >=20 > On 2021-06-21 19:44:16 -0500, Jerry Levan wrote: >> The below fails... the 'fe80....' is the ip6 address of big box. >> [jerry@bigbox ~]$ psql -h bigbox >> psql: error: FATAL: no pg_hba.conf entry for host = "fe80::fe3f:dbff:fed1:f62e%enp7s0", user "lxxx", database "lxxx", SSL = off >=20 > This looks like a configuration error in your DNS. FE80:... is a > link-local address, and you generally don't want them in DNS. Either > remove that completely (as others have already suggested) or replace = if > with the global unicast (or at least unique local) IPv6 address (and > then add that to pg_hba.conf). >=20 > If the address isn't in DNS, check your /etc/hosts. >=20 My dns is the Synology DNS that comes with their diskstation. When I set it up I did NOT include any IP6 info so it is not returning the IP6 address. The local name of my network is 'skynet'. bigbox has a freshly installed Fedora 34 system and it runs postgresql = 13.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.. I have three other machines running a postgresql database and I can use = attach to them using the long and short names with no problem from bigbox. ie psql -h and psql -h .skynet all work. So the question is: Why does using the short name evidently cause = postresql to use the ipv6 address and using the full name use the ipv4 address? The problem has a workaround 1) disable the server from listening on = ipv6 2) or add bigbox and bigbox.skynet to = /etc/hosts let me note that systemd-resolve { bigbox | bigbox.skynet } always = returns the ipv4 address...