Check network service connectivity with PortChecker tool

If you are unable to connect to a particular TCP service, such as a web server, ftp server, or anything else, you may be experiencing a number of both network and service connectivity problems:

  1. The hostname you typed in cannot be resolved
  2. The ip address of the server is not reachable due to network connectivity problems
  3. The server's firewall has rejected your connection
  4. The service is not running, or is not listening at the specified port

The PING command can help you determine whether you are experiencing 1-2.  But it doesnt help you actually determine whether you are having issues with 3-4.

I put together a little tool that can tests TCP connectivity to the specific port on the target machine, something that the PING command cannot do.  You can use it to determine whether IIS is listening on a particular ip/port and whether you can get to it – or test connectivity to any arbitrary TCP services (since it will expose DNS, network connectivity, lack of active listening connections), such as SQL Server.  Note that the tool doesn’t do any application protocol specific communication (such as making an HTTP request) – it simply establishes a TCP connection and closes it.

>> Download the tool / source code here << 

This code is distributed under the Microsoft Permissive Use License, meaning you can do with it whatever your please but I bear no responsibility for how you use it.

Then, run:

> PortCheck.exe localhost 80

The tool will report whether it connected successfully, timed out when connecting, or was rejected by firewall / because noone was listening on the port.

7 Comments

  1. Anonymous

    Type your cnmmeot You may use these HTML tags: <a> <abbr> <acronym> <b> <blockquote> <cite> <code> <del> <em> <i> <q> <strike> <strong> Notify me of followup cnmmeots via e-mail var RecaptchaOptions = { theme : ‘red’, lang : ‘pt’ , tabindex : 5 };   #submit {display:none;} Currently you have JavaScript disabled. In order to post cnmmeots, please make sure JavaScript and Cookies are enabled, and reload the page. on how to enable JavaScript in your browser.

  2. Anonymous

    A handy tool I can say! 🙂 I had to check the ports to a machine located in a secure zone and it is helpful validating stuff like this.

Leave a Reply

Your email address will not be published. Required fields are marked *