Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the meaning of port 0 in netstat -an output in Windows? I'm asking about socket in Foreign address column:

I know that address means, that host is listening on all interfaces, but what is the function of port zero?

share|improve this question
up vote 2 down vote accepted

If you see this as the "Foreign" address, the meaning is slightly different – it's not about the interface; that would be the "Local" address.

All zeros in the "Foreign" column just mean that there is no remote address yet. The line represents a listening socket, which will accept connections from any address, any port. Those connections would be displayed as separate lines.

(From what I remember, in some early systems it used to be possible to create TCP sockets that would only accept connections from a specific host, a specific port, or both.)

share|improve this answer
So to sum up: port 0 means ANY port? – rzr00 Feb 6 '12 at 8:03
Yes. In the Foreign address, 0:0 means any remote host, any remote port. (Just to remind: this column is not about local interfaces.) – grawity Feb 6 '12 at 8:34
@RZR A TCP listening socket or any UDP socket will basically always be listening for connections or datagrams from any port. – David Schwartz Feb 6 '12 at 9:56
… although a connect() on a UDP/IP socket will change this behaviour. – JdeBP Feb 6 '12 at 13:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.