By default the telnet client in Microsoft’s Windows operating systems is disabled, this is unfortunate as it is an extremely useful tool which can be used for testing TCP connectivity to external hosts on a specified port.
This is great when you’re trying to troubleshoot network connectivity problems, for example, say we have a web server which should be listening on port 80 to serve HTTP traffic but we are not able to load a web page, by using telnet to connect to the web server on port 80 we can verify the connectivity.
It may be that the connectivity is fine but there is a problem with the web server, or that the web server is stopped and the port is not listening at all, for instance. With telnet we can get a better understanding of what’s going on.
Enabling the telnet client
Firstly you need to enable the telnet client, if you don’t enable it you’ll get a result similar to the below message when trying to use it.
C:\>telnet google.com 80 'telnet' is not recognized as an internal or external command, operable program or batch file. C:\>
You can enable the client both by command line or through the graphical interface.
Enabling the telnet client through command line
Run the below command in command prompt with administrator permissions.
That’s it, after a few seconds telnet should be ready to use.
Enabling the telnet client through the graphical user interface
- Open the Start screen and select Control Panel. In the start screen you can simply type “control panel” and it will appear in the results.
- From the control panel, select Programs.
- Then select Programs and Features.
- From the left hand side select Turn Windows features on or off. This requires administrator privileges.
- The Windows Features window should open, scroll down and select “Telnet Client”. Do NOT install telnet server.
- Click the OK button to proceed, this will display a screen while the changes apply.
- When complete it will display as below, you can now close the window.
Verifying that the telnet client is enabled
Simply open command prompt or powershell, type ‘telnet’ and press enter. If this was successful you should have a prompt similar to the below:
Welcome to Microsoft Telnet Client Escape Character is 'CTRL+]' Microsoft Telnet>
Already have telnet installed but still failing?
In some cases you must run command prompt or powershell as administrator in order to issue the telnet command, otherwise it will give the same error as if it was not enabled at all.