Quick Answer
Use telnet only as a quick TCP port check: telnet host port. If the screen connects or goes blank, the TCP connection succeeded. If it times out or refuses, the port is blocked, closed, or unreachable. That single binary answer — connected vs. not — is why telnet is still useful 40 years after it was designed.
How to Install Telnet
| OS | Install Command | Notes |
|---|---|---|
| Ubuntu / Debian | sudo apt install telnet | Installs the client only |
| RHEL / CentOS / Fedora | sudo dnf install telnet | Client only |
| macOS | Built-in on older macOS; brew install telnet on newer | macOS removed it in 10.13+ |
| Windows 10/11 | Settings → Optional Features → Telnet Client | Or use PowerShell Test-NetConnection instead |
Examples
# Test if a web server is listening on port 80
telnet example.com 80
# Test SMTP on a mail server
telnet mail.example.com 25
# Test SSH on a local device
telnet 192.168.1.10 22
# Test a custom application port
telnet 10.0.0.5 8080
After connecting to port 80, you can manually type an HTTP request — but curl -v does this better with TLS support and structured output.
How to Interpret Results
| Result | Meaning | Next Step |
|---|---|---|
| Connected / blank screen | TCP handshake succeeded — something is listening | Service is reachable; investigate application layer if still broken |
| Banner text appears | Server sent an application greeting (SMTP, FTP, SSH) | Service is fully functional at the port level |
| Connection refused | Host is reachable but nothing is listening on that port | Check if the service is running; check the correct port number |
| Connection timed out | Firewall dropping packets, routing issue, or host is down | Ping the host; check firewall rules on both ends |
| Name or service not known | DNS resolution failed | Try with IP address directly; check DNS configuration |
Common Ports to Test
| Port | Service | What a Successful Connection Means |
|---|---|---|
| 22 | SSH | SSH daemon running; firewall allows connection |
| 25 | SMTP | Mail server accepting connections (banner should appear) |
| 80 | HTTP | Web server running unencrypted; blank screen until you send a request |
| 443 | HTTPS | TLS — telnet connects but you will see garbled data; use curl instead |
| 3389 | RDP | Windows Remote Desktop accepting connections |
| 5900 | VNC | VNC server running |
| 8080 | HTTP (alt) | Application or proxy server on non-standard port |
Modern Alternatives
Telnet works, but these tools give cleaner output for the same port-testing job:
# nc (netcat) — cleaner output, exits cleanly
nc -vz example.com 80
nc -vz 192.168.1.10 22
# curl — best for HTTP/HTTPS port and header testing
curl -v https://example.com/
curl -v --connect-timeout 5 http://192.168.1.10:8080/
# PowerShell (Windows) — no install needed
Test-NetConnection -ComputerName example.com -Port 80
Test-NetConnection -ComputerName 192.168.1.1 -Port 443
# nmap — most powerful, tests ranges of ports
nmap -p 22,80,443 example.com
| Tool | Best For | Availability |
|---|---|---|
| telnet | Quick binary port check with interactive response | Optional on all major OS |
| nc (netcat) | Scripted port checks, cleaner exit codes | Most Linux/macOS; needs install on Windows |
| curl | HTTP/HTTPS testing with full request/response detail | Built-in on macOS and most Linux; included in Windows 10+ |
| Test-NetConnection | Windows port testing without third-party tools | Built into Windows PowerShell |
| nmap | Multi-port scanning, service detection | Install separately; comprehensive |
Frequently Asked Questions
Is telnet secure?
Telnet as a remote login protocol is completely insecure — all traffic including passwords is sent in plain text. However, using the telnet client to test a TCP port is safe because you are only checking connectivity, not sending credentials. The risk is zero as long as you are not using telnet to actually log into a remote system.
Why is telnet not installed on Windows by default?
Microsoft removed it from default installs to reduce the attack surface — leaving telnet enabled as a server was a common misconfiguration. The client is still available as an optional feature. For port testing on Windows, PowerShell's Test-NetConnection is the better built-in alternative.
What does a blank telnet screen mean?
The TCP three-way handshake completed successfully and the server accepted the connection. The blank screen means the server is waiting for you to send something first (as HTTP, SMTP after EHLO, etc.). If you see text immediately, the server sent a banner — this is normal for SMTP, FTP, and SSH. Quit with Ctrl+] then type quit.
Why use nc instead of telnet?
nc -vz host port exits immediately after confirming the connection, returns a proper exit code (0 for success, 1 for failure) that scripts can use, and does not leave a hanging interactive session. For any automated testing or scripting, nc is the better tool. For interactive exploration where you want to type commands at the server, telnet is still fine.