BUG #1045: hostname lookup in psql or libpg.sl does work
The following bug has been logged online:
Bug reference: 1045
Logged by: Keith Halewood
Email address: keith_halewood@systems-intelligence.com
PostgreSQL version: 7.4
Operating system: HP-UX 11i
Description: hostname lookup in psql or libpg.sl does work
Details:
psql (and libpg.sl via the DBI and DBD::Pg interface) report:
psql: could not translate host name "ysolde" to address: host nor service
provided, or not known
despite ysolde, in this case, being available via the DNS and both nslookup
and dig (and all the other clients) correctly resolving names.
If 'ysolde' and its address are placed in the system's /etc/hosts file, psql
(and libpq.sl) is able to resolve an address and connect.
"PostgreSQL Bugs List" <pgsql-bugs@postgresql.org> writes:
psql (and libpg.sl via the DBI and DBD::Pg interface) report:
psql: could not translate host name "ysolde" to address: host nor service
provided, or not known
Couldn't duplicate this using HP's testdrive systems (HP 11.11).
I do get a message of exactly that spelling when providing a
deliberately incorrect hostname, though. I suspect pilot error on
your part, or misconfiguration of your DNS setup.
$ uname -a
HP-UX spe191 B.11.11 U 9000/800 1865940626 unlimited-user license
-- spe176 is a nearby machine that's not in /etc/hosts:
$ nslookup spe176
Using /etc/hosts on: spe191
looking up FILES
Trying DNS
Name: spe176.testdrive.hp.com
Address: 192.233.54.176
$ psql -l -p 5440 -h spe176
psql: could not connect to server: Connection refused
Is the server running on host "spe176" and accepting
TCP/IP connections on port 5440?
$ psql -l -p 5440 -h spe176.testdrive.hp.com
psql: could not connect to server: Connection refused
Is the server running on host "spe176.testdrive.hp.com" and accepting
TCP/IP connections on port 5440?
$ psql -l -p 5440 -h spe17dddfqz
psql: could not translate host name "spe17dddfqz" to address: host nor service provided, or not known
$
regards, tom lane