How to test the connectivity to a host from a Windows client

By working with multiple customers on different issues, I found that many people are not aware of how to test the connectivity to a host from a Windows client.

How to test the connectivity to a host from a Windows client
Gulian Technology

Almost everyone knows about the ping utility. However, in some situations, you need to test the connectivity to a particular host on a particular port and ping cannot help here. Also, in some environments, ping is useless because ICMP traffic is blocked altogether.

I will start by showing you how to test the connectivity with the ping command and I will also show you other methods that you can use to achieve the same goal.

Test the connectivity with the ping command

The most widely known method to test if a host is reachable or not is to use the ping utility. For that you need to open a command prompt (CMD) and run a similar command.

ping webserver.degulian.com
Connectivity fails

By default, the Windows operating system sends 4 ICMP echo request messages. If the requests are timing out, this means that either the host is down or there is a firewall blocking the ICMP traffic.

A successful connectivity test will look similar to the one below.

A successful connection

Test the connectivity with the telnet command

If you need to test the connectivity to a specific port, you will not be able to do it with the ping command. You can use the telnet command instead.

Just open a command prompt and run a similar command. I will test the connectivity to the same hostname on port 80.

telnet webserver.degulian.com 80
telnet is not recognized as an internal pr external command

You may see a message similar to this one: “‘telnet’ is not recognized as an internal or external command, operable program or batch file.” This is because, by default, the telnet client is not enabled on a Windows host.

To enable it, type telnet in the search field, look for and select “Turn Windows features on or off” and open it.

Open 'Turn Windows features on or off'

Add a checkbox in front of Telnet Client and press the OK button.

Enable Telnet Client

Wait a couple of seconds. You will see a message similar to the one below. Press the Close button to close the window.

Telnet Client enabled

After the Telnet Client was enabled, you just need to repeat the previous command from the command prompt.

In case of unsuccessful connection, you will encounter a message similar to this one: “Could not open connection to the host on port 80: Connection failed”.

Could not open connection to the host on port 80: Connection failed.

A successful connection will look like the screen below. To exit from the telnet command, press q on the keyboard and then press enter.

successful connection to host webserver.degulian.com on port 80

Test the connectivity from the PowerShell

The last method that I want to show you for testing the connectivity to a particular host is to use the PowerShell instead of the command prompt. Type “PowerShell” in the search box and press the Open button.

Search for and open the PowerShell
PowerShell

In the new window, you need to run a command similar to this one:

Test-NetConnection webserver.degulian.com -Port 80

An unsuccessful connection will look like the one below.

unsuccessful connection to webserver.degulian.com on port 80

A successful connection will look similar to this one.

successful connection to webserver.degulian.com on port 80

If you want to find more about the Test-NetConnection, check this link.

That’s it! You have learned how to test the connectivity to a specific host from a Windows client using three different methods. If you found this blog post helpful, please like and subscribe for more tutorials. Thank you for reading it!

Processing…
Success! You're on the list.

Leave a Reply