listen_addresses
Requires a restarthost list ('localhost', '*', IPs)
Which network interfaces the server accepts TCP connections on.
What it does
listen_addresses decides the network interfaces PostgreSQL binds to. 'localhost' (default) accepts only local connections; specific IPs bind to those interfaces; '*' listens on all of them. It's the first gate for remote access — pg_hba.conf and authentication are the next.
How to tune it
Keep it as restrictive as possible. Use '*' (or specific addresses) only when remote clients genuinely need to connect, and always pair it with tight pg_hba.conf rules, TLS, and a firewall. Never expose a database to the open internet without those. Changing it needs a restart.