telnet

Still incredibly useful for figuring out what's wrong with your connection to a server. #linux

telnet host.example.com 80

Connection hangs forever

A router between you and the host is down or your traffic has been filtered by a firewall.

$ telnet host.example.com 80
Trying <ip>...

DNS problems

$ telnet something.example.com 443
Server lookup failure:  something.example.com:443, Name or service not known

Connection refused

The host is reachable, but the port is closed.

$ telnet host.example.com 80
Trying <ip>...
telnet: Unable to connect to remote host: Connection refused

Closed by foreign host

The connection was immediately terminated by the host. This usually implies configuration issues on the application level, not the host level.

$ telnet host.example.com 80
Trying <ip>...
Connected to host.example.com.
Escape character is '^]'.
Connection closed by foreign host.

Connection successful

$ telnet samba.example.com 445
Trying 172.31.25.31...
Connected to samba.example.com.
Escape character is '^]'.
^]
telnet> quit
Connection closed.

Unless specified otherwise, this work is licensed under a Creative Commons BY-NC-SA 4.0.