Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WaCVb-0006c5-LO for pgsql-jdbc@arkaria.postgresql.org; Tue, 15 Apr 2014 23:11:19 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WaCVa-00055V-Ve for pgsql-jdbc@arkaria.postgresql.org; Tue, 15 Apr 2014 23:11:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WaCVa-00055O-4B for pgsql-jdbc@postgresql.org; Tue, 15 Apr 2014 23:11:18 +0000 Received: from prod-mail-xrelay08.akamai.com ([96.6.114.112]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WaCVW-0004X6-QA for pgsql-jdbc@postgresql.org; Tue, 15 Apr 2014 23:11:17 +0000 Received: from prod-mail-xrelay08.akamai.com (localhost.localdomain [127.0.0.1]) by postfix.imss70 (Postfix) with ESMTP id B01E548287 for ; Tue, 15 Apr 2014 23:11:13 +0000 (GMT) Received: from prod-mail-relay03.akamai.com (prod-mail-relay03.akamai.com [172.27.8.26]) by prod-mail-xrelay08.akamai.com (Postfix) with ESMTP id A40AD481A2 for ; Tue, 15 Apr 2014 23:11:13 +0000 (GMT) Received: from usma1ex-cashub.kendall.corp.akamai.com (usma1ex-cashub5.kendall.corp.akamai.com [172.27.105.21]) by prod-mail-relay03.akamai.com (Postfix) with ESMTP id 7EDAE2FD66 for ; Tue, 15 Apr 2014 23:11:13 +0000 (GMT) Received: from [172.28.9.200] (172.28.9.200) by usma1ex-cashub5.kendall.corp.akamai.com (172.27.105.21) with Microsoft SMTP Server (TLS) id 8.3.342.0; Tue, 15 Apr 2014 19:11:12 -0400 Message-ID: <534DBC90.2080401@akamai.com> Date: Tue, 15 Apr 2014 19:11:12 -0400 From: Scott Mitchell User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Subject: Re: 9.3-1101-jdbc41 potential issue resolving DNS names to host names References: <534DB8DA.6060705@akamai.com> In-Reply-To: <534DB8DA.6060705@akamai.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org Another interesting symptom is that if I try psql I get some strange behavior... $ssh $psql --host="" psql: could not connect to server: Connection refused Is the server running on host "" () and accepting TCP/IP connections on port 5432? It seems like the is resovling to the local IP (which is )? But if I explicitly try the IP I am able to connect to the database (connection is rejected but that is expected). $ssh $psql --host="" psql: FATAL: connection requires a valid client certificate FATAL: pg_hba.conf rejects connection for host "", user "root", database "root", SSL off This makes me think it may not be a postgresql jdbc specific issue but I am still not quite sure. Another interesting piece of the puzzle is that is running a warm standby instance of the database. The postgresql instance is currently not running on this machine but I'm not sure if that may affect anything. -Scott On 04/15/2014 06:55 PM, Scott Mitchell wrote: > I have tried a few scenarios which I will list below but it seems as > though there may be an issue with how host names are resolved to IPs. > This seems like it would be a widely used feature and so I'm not ruling > out a configuration or other issue on my end. > > I am attempting to establish connections from IP address X to IP address Y. > There is a HOSTNAME which has an A record pointing to IP address Y. > SSL is involved but should not be relevant because I can get a working > and non-working scenario while SSL configuration remains unchanged. > > Good: The following connection string works as expected (from IP address X): > jdbc:postgresql:/// > > Bad: The following connection string does not work (from IP address X): > jdbc:postgresql:/// > > The only difference between the two scenarios is the connection string. > > I have run the following commands to verify that the DNS name does > resolve to the correct IP address (and substituted the actual output for > the variables mentioned) > > $ssh > $dig +noall +answer > . 120 IN A > > Another scenario I tried is running the same code on IP address X and > change the connection string host to "localhost". The local host is > able to resolve and the connection is established as expected. This may > be a trivial lookup and may just go directly to loopback interface > without resolving DNS, but this scenario may be relevant to this issue > as it is not an IP. > > Any help is appreciated. > -Scott > > -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc