From: Scott Mitchell <smitchel@akamai.com>
To: pgsql-jdbc@postgresql.org
Subject: 9.3-1101-jdbc41 potential issue resolving DNS names to host names
Date: Tue, 15 Apr 2014 18:55:22 -0400
Message-ID: <534DB8DA.6060705@akamai.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>
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://<IP address Y>/<Database>
Bad: The following connection string does not work (from IP address X):
jdbc:postgresql://<HOSTNAME>/<Database>
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 <IP address X>
$dig +noall +answer <HOSTNAME>
<HOSTNAME>. 120 IN A <IP address Y>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: smitchel@akamai.com
Subject: Re: 9.3-1101-jdbc41 potential issue resolving DNS names to host names
In-Reply-To: <534DB8DA.6060705@akamai.com>
References: <534DB8DA.6060705@akamai.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox