How do I know if a TCP port is open or closed?

Purpose

This article explains how to check if a TCP port is open or closed on different operating systems when you suspect that any of the following issues resulted in a closed port:

Resolution

On a Windows computer

  1. Press the Windows key and type "Windows features" in the search bar. Then, select Turn Windows features on or off.

  2. Tick the Telnet Client checkbox and click OK.

  3. Press the Windows key + R, then type "cmd.exe" and click OK.

  4. Enter "telnet + IP address or hostname + port number" (e.g., telnet www.example.com 1723 or telnet 10.17.xxx.xxx 5000) to run the telnet command in Command Prompt and test the TCP port status.

  5. If the port is open, only a cursor will show.If the port is closed, a message will say Connect failed.

On a Mac computer (before macOS 11 Big Sur)

  1. Click the Spotlight icon  in the upper-right hand corner or press Command + Space bar.

  2. Type "Network Utility" in the search field and select Network Utility.

  3. Select Port Scan, enter an IP address or hostname in the text field, and specify a port range. Click Scan to begin the test. If a TCP port is open, it will be displayed here.

On a Linux computer