pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #7632: Postgres binds to all IPs even when listen_addresses="localhost"
4+ messages / 4 participants
[nested] [flat]

* BUG #7632: Postgres binds to all IPs even when listen_addresses="localhost"
@ 2012-10-31 19:38  pj@illuminatedcomputing.com
  0 siblings, 1 reply; 4+ messages in thread

From: pj@illuminatedcomputing.com @ 2012-10-31 19:38 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      7632
Logged by:          Paul Jungwirth
Email address:      pj@illuminatedcomputing.com
PostgreSQL version: 9.1.6
Operating system:   Ubuntu 12.04 LTS, x86_64
Description:        

After a default install of Postgres, I see that it's binding not just to
localhost, but also to my public IP. The port is reported open by nmap, and
I see this:

    # netstat -an | grep 5432
    tcp        0      0 66.175.223.51:5432      0.0.0.0:*              
LISTEN     
    tcp        0      0 127.0.0.1:5432          0.0.0.0:*              
LISTEN     

Postgres still binds to the public IP even after I uncomment the
`listen_addresses` line at `/etc/postgresql/9.1/main/postgresql.conf`, set
it to the following, and do `service postgresql restart`:

    listen_addresses = 'localhost'







^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #7632: Postgres binds to all IPs even when listen_addresses="localhost"
@ 2012-10-31 20:06  Tom Lane <tgl@sss.pgh.pa.us>
  parent: pj@illuminatedcomputing.com
  0 siblings, 1 reply; 4+ messages in thread

From: Tom Lane @ 2012-10-31 20:06 UTC (permalink / raw)
  To: pj@illuminatedcomputing.com; +Cc: pgsql-bugs

pj@illuminatedcomputing.com writes:
> After a default install of Postgres, I see that it's binding not just to
> localhost, but also to my public IP.

This behaves as expected for me.  I'm wondering whether your DNS
server is resolving "localhost" as meaning both 127.0.0.1 and your
public IP.  "dig localhost." might be illuminating.

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #7632: Postgres binds to all IPs even when listen_addresses="localhost"
@ 2012-10-31 20:43  Paul Jungwirth <pj@illuminatedcomputing.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 4+ messages in thread

From: Paul Jungwirth @ 2012-10-31 20:43 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs

> This behaves as expected for me.  I'm wondering whether your DNS
> server is resolving "localhost" as meaning both 127.0.0.1 and your
> public IP.  "dig localhost." might be illuminating.

Wow, that is some psychic debugging. Sure enough, my /etc/hosts is
setting localhost to both 127.0.0.1 and my other IP. Using
`listen_addresses = '127.0.0.1'` fixes the problem.

Thank you!
Paul

-- 
_________________________________
Pulchritudo splendor veritatis.




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #7632: Postgres binds to all IPs even when listen_addresses="localhost"
@ 2012-10-31 21:01  John R Pierce <pierce@hogranch.com>
  parent: Paul Jungwirth <pj@illuminatedcomputing.com>
  0 siblings, 0 replies; 4+ messages in thread

From: John R Pierce @ 2012-10-31 21:01 UTC (permalink / raw)
  To: pgsql-bugs

On 10/31/12 1:43 PM, Paul Jungwirth wrote:
>> This behaves as expected for me.  I'm wondering whether your DNS
>> >server is resolving "localhost" as meaning both 127.0.0.1 and your
>> >public IP.  "dig localhost." might be illuminating.
> Wow, that is some psychic debugging. Sure enough, my /etc/hosts is
> setting localhost to both 127.0.0.1 and my other IP. Using
> `listen_addresses = '127.0.0.1'` fixes the problem.


fix your /etc/hosts .... thats an artifact of the #@$@# RHEL installer, 
if the network isn't properly configured at install time, it loves to do 
that with the hostname.



-- 
john r pierce                            N 37, W 122
santa cruz ca                         mid-left coast





^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2012-10-31 21:01 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-10-31 19:38 BUG #7632: Postgres binds to all IPs even when listen_addresses="localhost" pj@illuminatedcomputing.com
2012-10-31 20:06 ` Tom Lane <tgl@sss.pgh.pa.us>
2012-10-31 20:43   ` Paul Jungwirth <pj@illuminatedcomputing.com>
2012-10-31 21:01     ` John R Pierce <pierce@hogranch.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox