Type: | string |
Default: | localhost |
Context: | postmaster |
Restart: | true |
Specifies the TCP/IP address(es) on which the server is to listen for connections from client applications. The value takes the form of a comma-separated list of host names and/or numeric IP addresses. The special entry *
corresponds to all available IP interfaces. The entry 0.0.0.0
allows listening for all IPv4 addresses and ::
allows listening for all IPv6 addresses. If the list is empty, the server does not listen on any IP interface at all, in which case only Unix-domain sockets can be used to connect to it. The default value is localhost, which allows only local TCP/IP loopback connections to be made. While client authentication (client-authentication) allows fine-grained control over who can access the server, listen_addresses
controls which interfaces accept connection attempts, which can help prevent repeated malicious connection requests on insecure network interfaces. This parameter can only be set at server start.
Recommendations
On StackOverflow
On pgsql-hackers
- Re: [PATCH] Teach pg_waldump to extract FPIs from the WAL
- Re: Patch proposal: make use of regular expressions for the username in pg_hba.conf
- Re: Adding a pg_servername() function
- Re: Document that server will start even if it's unable to open some TCP/IP ports
- Re: [PATCH] Allow Postgres to pick an unused port to listen