Testing Port Connectivity

Testing Port Connectivity

netcat on Linux and MacOS, and Test-NetConnection on Windows.

The netcat tool can be run through the command nc, and ​has two mandatory arguments, a host and a port.

Running “nc google.com 80” would try to establish a connection on ​port 80 to google.com

  • if the connection fails, the command will exit. 
  • ​If it succeeds, you’ll see a blinking cursor waiting for more input.

​If you’re really only curious about the status of a port, ​you can issue the command with the -Z flag, which stands for zero input output mode. ​The -V flag, which stands for verbose is also useful in this scenario.

 ​On Windows, TestNetConnection is a command with some of the similar functionality.