There are many online tools for testing services offered by a server but those tests only indicate the view from the online tool. Sometimes you need to test connectivity from your local computer. This article describes how to use PowerShell and tnc to troubleshoot network applications.
PowerShell is a task-based command-line shell and scripting language included with all currently supported versions of Windows. tnc is a PowerShell command that displays diagnostic information for a connection.
To launch PowerShell, press the Windows key on the keyboard and begin typing PowerShell until the PowerShell Desktop Application option is visible. Click on the PowerShell Desktop Application icon to launch PowerShell.
To use tnc to test basic network connectivity, you need to know two things:
To test a connection to a remote server, open a PowerShell window on your computer, and then type tnc IP/host -port port, where IP/host represents the IP address or hostname of the server, and port represents the TCP port number. For example, to test to example.com on port 80, type the following command:
tnc example.com -port 80
When you try to establish a connection to a remote server, one of two things happens:
The following sections demonstrate how to do basic telnet troubleshooting with some common network applications.
Web server testing is probably the most common scenario for network troubleshooting. With tnc you can test a connection to a remote server on port 80. The following text shows the tnc test. Text in red represents commands typed by the user:
>tnc example.com -port 80
ComputerName : toomanycats.com
RemoteAddress : 192.168.0.62
RemotePort : 80
InterfaceAlias : Ethernet
SourceAddress : 10.0.0.28
TcpTestSucceeded : True
tnc reports TcpTestSucceeded : True indicating a TCP connection can be made to the server on port 80
To test an SMTP server, use tnc to connect to port 25.
If you are testing connectivity to an A2 Hosting mail server, you can also use port 2525 or 587. Some ISPs block port 25 to help reduce spam on their networks.
The following text shows the tnc test of a remote mail server. Text in red represents commands typed by the user:
>tnc example.com -port 25
ComputerName : example.com
RemoteAddress : 192.168.0.62
RemotePort : 25
InterfaceAlias : Ethernet
SourceAddress : 10.0.0.28
TcpTestSucceeded : True
tnc reports TcpTestSucceeded : True indicating a TCP connection can be made to the server on port 25
To test an FTP server, use tnc to test port 21.
The following text shows the tnc test of a remote FTP server. Text in red represents commands typed by the user:
>tnc example.com -port 21
ComputerName : example.com
RemoteAddress : 192.168.0.62
RemotePort : 21
InterfaceAlias : Ethernet
SourceAddress : 10.0.0.28
TcpTestSucceeded : True
tnc reports TcpTestSucceeded : True indicating a TCP connection can be made to the server on port 21
SSH uses encrypted connections. However, you can still use telnet to verify that the service is running on a server.
The following text shows the tnc test of a remote SSH server. Text in red represents commands typed by the user:
>tnc example.com -port 7822
ComputerName : example.com
RemoteAddress : 192.168.0.62
RemotePort : 22
InterfaceAlias : Ethernet
SourceAddress : 10.0.0.28
TcpTestSucceeded : True
tnc reports TcpTestSucceeded : True indicating a TCP connection can be made to the server on port 7822
Remember that A2 Hosting servers use port 7822 for SSH instead of the default port 22.
Subscribe to receive weekly cutting edge tips, strategies, and news you need to grow your web business.
No charge. Unsubscribe anytime.
Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.
We use cookies to personalize the website for you and to analyze the use of our website. You consent to this by clicking on "I consent" or by continuing your use of this website. Further information about cookies can be found in our Privacy Policy.