When connecting to PostgreSQL, I get a "Could Not Translate Hostname to Address" error.

psql: could not translate host name "cluster-do-user-1234567-0.db.ondigitalocean.com" to address: Name or service not known

A Could Not Translate Hostname to Address error occurs when:

  • You use the wrong DNS hostname.
  • There are underlying problems with DNS resolution.

If you are getting this error:

Diagnose and troubleshoot your Droplet’s network configuration.
Verify that the hostname is correct and that you’ve created the database.
Check your cluster and username/password combination.