Troubleshooting Network Applications with Telnet
The Telnet program is a valuable diagnostic tool for network troubleshooting. Learn how to use Telnet effectively in this guide.
About Telnet
Telnet was once the standard program for connecting to remote servers. However, since it sends data unencrypted, it has largely been replaced by SSH (Secure Shell) for secure connections.
Despite that, Telnet remains a useful troubleshooting tool. You can use it to test TCP connections to remote servers on any port, and even send raw commands once connected to analyze responses.
Enabling Telnet
-
Linux: Telnet is included by default.
-
Windows 10: Telnet is part of the Windows Subsystem for Linux but can also be installed manually.
-
macOS: Older versions included Telnet by default; newer versions require manual installation.
Tip:
Don’t want to install Telnet? You can troubleshoot networks using curl, PowerShell, or tnc—tools that are available on most systems.
Using Telnet to Troubleshoot
To troubleshoot a network application using Telnet, you need:
-
The remote server name or IP address.
-
The port number for the application you’re testing.
For basic connectivity tests, that’s all you need. For deeper protocol-level testing (like HTTP or SMTP), you’ll need to know the relevant command syntax.
To open a connection:
-
Open a terminal.
-
Type:
telnet IP/host portExample:
telnet example.com 80
Tip:
For a full list of TCP/UDP port numbers, visit Wikipedia’s Port List.
When connecting:
-
If the server accepts the connection, Telnet may display text or wait for your input.
-
If the server rejects it, you’ll see a message such as “Connection refused” or “Connect failed.”
Below are examples of Telnet troubleshooting with common applications.
Troubleshooting Web Servers
Testing web servers is one of the most common uses for Telnet.
Example:
$ telnet example.com 80
Trying 192.168.0.62…
Connected to example.com.
Escape character is '^]'.
GET / HTTP/1.1
Host: example.com
HTTP/1.1 200 OK
Accept-Ranges: bytes
Cache-Control: max-age=604800
Content-Type: text/html
This confirms that the server accepts connections and responds to HTTP requests.
Troubleshooting Mail (SMTP) Servers
To test an SMTP server, connect to port 25:
$ telnet example.com 25
Trying 192.168.0.62…
Connected to example.com.
Escape character is '^]'.
220-example.com ESMTP Exim 4.7
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.
EHLO a2example.com
250-example.com Hello a2example.com [192.168.3.232]
250-AUTH PLAIN LOGIN
QUIT
These SMTP responses confirm that the mail server is active and accepting connections.
Note:
If you’re testing connectivity to a ruachost.com mail server, you can also use ports 2525 or 587, as some ISPs block port 25 to reduce spam.
Troubleshooting FTP Servers
To test FTP, connect to port 21:
$ telnet example.com 21
Trying 192.168.0.62…
Connected to example.com.
Escape character is '^]'.
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 18 of 50 allowed.
220-Local time is now 12:46. Server port: 21.
220-This is a private system - No anonymous login
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
This output confirms that the FTP service is up and running.
Troubleshooting SSH Connections
Though SSH uses encrypted connections, you can still test if the service is active:
$ telnet example.com 22
Trying 192.168.0.62…
Connected to example.com.
Escape character is '^]'.
SSH-2.0-OpenSSH_5.3
This response indicates the server’s SSH version and that the service is operational.
Note:
Always use the correct SSH port for your account. Some servers, including ruachost.com, may use custom SSH ports such as 7822.