`ss -tlnp` shows the app listening on `127.0.0.1:5432`, and remote clients can't connect.
BeginnerTroubleshootingNetworking, DNS and firewalls
Answer
Likely causes → The service is bound to loopback only (PostgreSQL's default listen_addresses = 'localhost').
Diagnose →
sudo ss -tlnp | grep 5432
grep listen_addresses /var/lib/pgsql/data/postgresql.conf
Fix → Set listen_addresses = '10.0.1.20' (or '*' with firewall restrictions), allow clients in pg_hba.conf, restart PostgreSQL, open the firewall.
Prevent → Bind to specific private IPs, not 0.0.0.0, and firewall the port.
More on Networking, DNS and firewalls
`curl http://10.0.1.20:8080` returns `curl: (7) Failed to connect to 10.0.1.20 port 8080: Connection refused`.BeginnerThe same request instead hangs and ends with `curl: (28) Failed to connect to 10.0.1.20 port 8080 after 130000 ms: Connection timed out`. How is this different from "refused"?Beginner`ping google.com` fails with `ping: google.com: Temporary failure in name resolution`, but `ping 8.8.8.8` works.Beginner`dig api.internal` works, but the application and `curl` fail with `Could not resolve host: api.internal`.Intermediate`/etc/resolv.conf` changes you made disappear after a reboot or a few minutes.BeginnerDNS lookups take exactly 5 seconds before succeeding.Intermediate