Interview Prep/Linux/Networking, DNS and firewalls

`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.

All Linux questions Roadmap: Linux

More on Networking, DNS and firewalls