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.
Update October 21st 2015: I have also created a video showing the process:
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 either 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.
dism /online /Enable-Feature /FeatureName:TelnetClient
That’s it, after a few seconds telnet should be ready to use.
Enabling the telnet client through the graphical user interface
- Right click the start button and select “Programs and Features”.
- Select “Turn Windows features on or off” from the menu on the left.
- The Windows Features window should open, scroll down and select “Telnet Client”.
- 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.
Now that you have enabled telnet you should be able to start issuing commands with it and using it to troubleshoot TCP connectivity problems.