Resolving the psql error: "error: could not translate host name to address: nodename nor servname provided, or not known"
Written by
Updated at November 27, 2023
Issue description
You have no public access to the PostgreSQL cluster and see this error:
psql: error: could not translate host name to address: nodename nor servname provided, or not known
Solution
Check whether public access to PostgreSQL cluster hosts is enabled. A host in the cluster could be accessible from outside Yandex Cloud if public access was enabled when creating the host or updating its settings.
If public access is disabled, enable it.
In the documentation, you can find a guide for connecting to a database in a PostgreSQL cluster.