Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fpflg-0003k7-KP for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Aug 2018 20:18:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fpflc-0008IK-4S for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Aug 2018 20:18:12 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fpflb-0008ID-8D for pgsql-hackers@lists.postgresql.org; Tue, 14 Aug 2018 20:18:11 +0000 Received: from smtp1.dreamhost.com ([64.90.62.170] helo=pdx1-sub0-mail-a15.g.dreamhost.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fpflX-0002hv-Sz for pgsql-hackers@lists.postgresql.org; Tue, 14 Aug 2018 20:18:09 +0000 Received: from pdx1-sub0-mail-a15.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a15.g.dreamhost.com (Postfix) with ESMTP id D693281497; Tue, 14 Aug 2018 13:18:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cryptonector.com; h=date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=cryptonector.com; bh=vO+TnFfitlzXeG KN903kuEqHLgo=; b=hZN+aJO6afm8OqbSWY0mNgykrFvq4fRBUptA/4LrUUKalO AJSL3uCU5ejXO5YUMfeMor9dLI/BvZhqaI3gifDSu3XJMW9jf1bWJmMplNJEI4Nt L9LALKvSpRWhMePKM/BQPAW5OneUYlYu99s/Z694Tn2zIi2cnkfwVd3GM3Ifw= Received: from localhost (unknown [24.28.108.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by pdx1-sub0-mail-a15.g.dreamhost.com (Postfix) with ESMTPSA id 439627FFE6; Tue, 14 Aug 2018 13:18:05 -0700 (PDT) Date: Tue, 14 Aug 2018 15:18:03 -0500 From: Nico Williams To: Garick Hamlin Cc: Fabien COELHO , Tom Lane , PostgreSQL Developers Subject: Re: libpq should not look up all host addresses at once Message-ID: <20180814201802.GE30604@localhost> References: <4913.1533827102@sss.pgh.pa.us> <27728.1534189594@sss.pgh.pa.us> <20180814191832.GD6776@isc.upenn.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180814191832.GD6776@isc.upenn.edu> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, Aug 14, 2018 at 03:18:32PM -0400, Garick Hamlin wrote: > On Tue, Aug 14, 2018 at 12:24:32PM +0200, Fabien COELHO wrote: > > I read the rational of the host/hostaddr artificial mapping. I cannot say > > I'm thrilled with the result: I do not really see a setting where avoiding a > > DNS query is required but which still needs a hostname for auth... If you > > have GSSAPI or SSPI then you have an underlying network, in which a dns > > query should be fine. > > FWIW, I think this is useful even it will be uncommon to use. I run > some HA services here and I find I use this kind of functionality all > the time to test if a standby node functioning properly. openssh > GSSAPIServerIdentity does this. curl does this via '--resolve'. In > both cases one can check the name authenticates properly via TLS or > GSSAPI while connecting to an IP that is not production. +1 curl's --resolve is a fantastic diagnostic tool. I wish it also allowed changing the destination port as well. While I'm at it, I strongly prefer using postgresql: URIs to any other way to specify connect info, and I think PG should do more to encourage their use -- perhaps even deprecating the alternatives. Nico --