Error Message: Error while connecting to the host - could not open a connection to host on port 23

Updated: November 16, 2007

Applies To: Windows Server 2008

This problem typically occurs when the Telnet server is configured to listen on a different TCP port number than the Telnet client is using to attempt a connection.

Telnet uses TCP port 23 by default when communicating from the client to the server. The port number used can be changed by an administrator. If it is changed, the client must know what number to instruct the Telnet client to use.

The error message will display the port number that was used in the attempt to connect. This can be caused by either of the following:

  • The TCP port number used by the client in its connection attempt is not the same port number configured to be used by the Telnet server.

  • The Telnet server is not started, and so is not listening on the expected port number.

To resolve this problem, do one of the following:

To confirm the port number that the Telnet server is currently listening on, run the command netstat -ab from an elevated command prompt (which was opened by using the Run as administrator option). The output should include an entry similar to the following:

TCP [::]:23 computername:0 LISTENING


The entry might also say ESTABLISHED instead of LISTENING.

The number in the second column indicates the port number on which the service is listening. If the entry for tlntsvr.exe is missing, then the service is likely not started.

See Also

Community Additions