How to check if a port is open from a local machine

2 minute read time.

Have you ever run into connection issues with X3 and needed a quick way to check if the proper ports were open on the server without getting access to the server?  Well today is your lucky day!  In this post, we will take a quick look at two different options you can use to check for open ports right from the comfort of your local machine.

First up is Telnet.  Since this utility is disabled by default, it will need to be enabled before we can dig in and start checking ports on the server.  To enable telnet through the GUI (graphical user interface—a.k.a. the windows you most likely spend most of your time looking at):

Open the Windows Start menu > type “Control Panel” > press Enter > “Programs” > “Turn Windows features on or off” > Select “Telnet Client” > press “OK”

 

Alternatively, telnet can be installed from an elevated command prompt:

Open Windows Start menu > type “Command Prompt” > select “Run as administrator” > type “Dism /Online /Enable-feature /FeatureName:TelnetClient” > press Enter

 

Now that telnet is enabled, it can be accessed through the command prompt using the command “telnet”.

Once opened, use the following syntax: open [URL or IP address] [port number].  For example, to check if port 80 is open on google.com:

 

After the initial connecting message, if you see “Press any key to continue” prompt, this confirms that the port is open and responding to telnet.  If you see “Could not open connection” or a blank screen with a blinking cursor, the port you tried to use is closed.  For further information on the telnet utility, refer to this documentation from Microsoft.

 

Another built-in Window utility that can be used to check if a port is open is the PowerShell utility Test-NetConnection.  This utility has multiple uses, from providing you with your local IP address, verifying that you have an internet connection, running a TraceRoute (to see network hops between the source and the target host), and of course scanning for open ports.  To access this utility, open the Windows Start menu and type “PowerShell”, then select Run as Administrator (not required to check open ports, but will allow access to other features of the utility).

 

 

From your PowerShell window, use the syntax Test-NetConnection [URL or IP address] -Port [port number].  To save a few keystrokes, the command tnc works as well.  For our example, we will once again test google.com for port 80:

We see that the result of TcpTestSucceeded is True, telling us that the servers for google.com have port 80 opened.  For additional information about the Test-NetConnection command, please refer to this Microsoft documentation.

In the case of our connection issues to X3, these utilities can be used to check if your web server has the correct ports opened (8124 by default), as long as you know the URL used to access X3, or the IP address of the web server.  These utilities can also be invaluable in troubleshooting many other network-related issues, but that is a discussion best server in another forum. 

Until next time!