Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cE3M8-000144-M2 for pgsql-admin@arkaria.postgresql.org; Tue, 06 Dec 2016 00:11:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cE3M7-0006p6-8r for pgsql-admin@arkaria.postgresql.org; Tue, 06 Dec 2016 00:11:35 +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.84_2) (envelope-from ) id 1cE3KO-0004md-Pd for pgsql-admin@postgresql.org; Tue, 06 Dec 2016 00:09:48 +0000 Received: from mailfront1.g2host.com ([209.98.94.161] helo=g2host.com) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cE3KK-0001xc-Gz for pgsql-admin@postgresql.org; Tue, 06 Dec 2016 00:09:45 +0000 Received: from [173.160.127.121] (account dennisr@visi.com HELO cletus.kabonkulator.com) by visi.com (CommuniGate Pro SMTP 6.1.11) with ESMTPSA id 72127647; Mon, 05 Dec 2016 18:09:23 -0600 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: Re: Are dns CNAME's allowed or useable in pg_hba.conf hostname specification From: "dennisr@visi.com" In-Reply-To: <3120.1480979712@sss.pgh.pa.us> Date: Mon, 5 Dec 2016 18:09:22 -0600 Cc: pgsql-admin@postgresql.org, Scott Whitney Content-Transfer-Encoding: quoted-printable Message-Id: <26EFFF38-A2FF-4BCB-A24D-4FD2D9E5E9EB@visi.com> References: <576363D5-19B5-4B34-A3C1-4D8BF63D3C78@visi.com> <712E05C9-E2D7-49CD-834E-26BA911C8D8A@visi.com> <369ED3B4-CAF3-4BBB-904F-E86999249D8E@visi.com> <3120.1480979712@sss.pgh.pa.us> To: Tom Lane X-Mailer: Apple Mail (2.3251) X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org > On Dec 5, 2016, at 5:15 PM, Tom Lane wrote: >=20 > "dennisr@visi.com" writes: >> Thanks for the quick reply. Here=E2=80=99s some details on how we have = things configured. >> We are using RHEL 7.3, the DNS names below have been changed to protect= the innocent or not so innocent depending on your point of view. >=20 >> If I do a nslookup on the database host against the following CNAME some= -cname-host.example.com I get: >=20 >> $> nslookup some-cname-host.example.com >> Server: 10.97.40.215 >> Address: 10.97.40.215#53 >=20 >> some-cname-host.example.com canonical name =3D canonical-host-n= ame.example.com. >> Name: canonical-host-name.example.com >> Address: 10.65.160.213 >=20 >> When I do the reverse lookup on the IP address return above I get the fo= llowing: >=20 >> $> nslookup 10.65.160.213 >> Server: 10.97.40.215 >> Address: 10.97.40.215#53 >=20 >> 213.160.65.10.in-addr.arpa name =3D canonical-host-name.example.com. >=20 > Given that, what you would have to put in pg_hba.conf is > canonical-host-name.example.com (and that needs to forward-resolve to > 10.65.160.213, and possibly other addresses as well). This cross-check > is meant to prevent getting into a PG server by means of a faked > reverse-DNS entry. >=20 > (If you're wondering why we don't simply accept anything that > some-cname-host.example.com forward-maps to, it's for performance reasons: > that would require resolving every DNS name in pg_hba.conf to see if it > matches, which could be pretty awful with long pg_hba.conf files.) >=20 > regards, tom lane >=20 OK thanks, sadly not the answer I was hoping for though.=20=20 My preference is to use a network address for this stuff but I was over rul= ed and needed to use a host specific name or address in the config file. I = wanted to use a CNAME in place of the A or PTR records so as in the event w= e ever have to rebuild a new WAL receiver, I would only need to repoint the= CNAME in the DNS system and avoid the possibility of updating a few hundre= d pg_hba.conf=E2=80=99s with a new IP address or hostname (this is a privat= e cloud environment I am working with so I don=E2=80=99t have a lot of cont= rol over hostnames of the nodes they give me or even the networks the node = is placed in.) Dennis --=20 Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin