Posts Tagged ‘telnet’

Telnet to a port to see if a service is running

Wednesday, June 20th, 2012

We’ve talked about telnetting to a port before, so I’ll make this a quick one: Telnet can be a useful tool for making sure that a service is running and can be accessed from a particular server.

TCP communications – whether they’re web requests, mail transport, or WebCenter Interaction Services such as search – use the same transport layer that requires two IP addresses and two ports. You probably already know the necessary IP address of your servers, and don’t need to worry about your own IP and port (which is chosen automatically by the operating system), but once you identify the remote port of the service you want to check, it’s pretty easy to confirm that a service is at least responding.

Recent versions of Windows don’t install the telnet client by default, but if you go to the Control Panel and find “Turn Windows Features On and Off”, you can turn on the telnet client in Windows 7 (it’s under “Add/Remove Programs” in previous versions:

Once the Telnet client is installed, just open a command prompt and type:

telnet <server> <port>

For example, you can check that this site is responding on port 80 (the default HTTP port) by running:

telnet 80

Once you do, you’ll get a blank screen, and you can start typing commands the conform to the HTTP protocol, such as:

GET /site/integryst.i

The details of confirming the behavior are beyond the scope of this post, but the key thing you should take away is that if the screen goes blank when you type the telnet command, the server is responding. If you get a “Connect Failed” message, that means your machine couldn’t connect – and it’s likely that other services in your infrastructure can’t either.

And, if you do get that blank screen, you can exit out of the telnet session by hitting CTRL-] to get to the telnet prompt, then type “quit”.