How to tell if a port is open

To determine if a port such as 80 or 5432 has been opened on a server, do the following on the machine trying to connect to the server.


1. Download the PortQry utility (to download, for information)

2. Install the PortQry utility.   Note, the example below assumes it will be installed to C:\PortQryV2 but it does not have to be.

3. Open a command line prompt (i.e. Windows > Run > cmd)

4. Type the following command replacing <server-name or ip> with the server name or the ip address and <port> with the port number. 

Note, if portqry was not installed in the C:\PortQryV2 directory, then change that to the installation location.

c:\PortQryV2\portqry -n <server-name or ip> -p both -e <port>


c:\PortQryV2\portqry -n -p both -e 5432

If the port is open, it should be listed with status of LISTENING.  For example:

TCP port 80 (http service): LISTENING

The possible status values (after the colon) are:

  • Listening = the server is listening on the specified port (i.e. it is open)
  • Filtered = likely indicates a firewall or software issue blocking the port
  • Not Listening = it didn't receive a response at all

© 2023 Foray, LLC - All Rights Reserved