Telnet on Windows 11 and 10: how to enable it, use it and test a port

Terminal window on a computer screen, the kind of console where you run the telnet command in Windows

Quick answer: Telnet Client is included with Windows 11 and Windows 10 but is turned off by default. To turn it on, search the Start menu for Turn Windows features on or off, tick Telnet Client and select OK. Or open an administrator command prompt and run dism /online /Enable-Feature /FeatureName:TelnetClient. Then connect with telnet host port, for example telnet mail.example.com 25. Telnet isn’t encrypted, so use it for quick port tests, not for logging in to anything.

Applies to: Windows 11 and Windows 10 (Home, Pro and Enterprise), and Windows Server, where Telnet Client is also an optional feature.

Terminal window on a computer screen, the kind of console where you run the telnet command in Windows

What telnet is (and what it’s used for today)

Telnet is an old protocol for opening a text session with another computer over TCP, by default on port 23. Windows ships a Telnet Client that you run as telnet from Command Prompt or PowerShell.

Today almost nobody uses telnet to log in to servers, because everything, including passwords, travels as plain text. It’s still handy for two jobs:

  • Checking whether a TCP port on another machine is reachable, for example a mail server on port 25 or a web server on port 80.
  • Talking to old network gear, lab equipment or text-based services that only offer telnet.

If you only need a port check, PowerShell’s Test-NetConnection does it without installing anything. See the section below.

Enable Telnet Client in Windows Features

You need an administrator account for this. The steps are the same on Windows 11 and Windows 10:

  1. Select Start, type Turn Windows features on or off and open the result. You can also press Win + R, type optionalfeatures and press Enter.
  2. Scroll down and tick Telnet Client.
  3. Select OK and wait while Windows applies the change. Restart if it asks you to.
  4. Open a new Command Prompt or PowerShell window and type telnet. You should see the Microsoft Telnet> prompt. Type quit to leave it.

The same dialog is in Control Panel > Programs > Programs and Features > Turn Windows features on or off on both versions. Recent Windows 11 versions also link to it from Settings > System > Optional features, under More Windows features.

Enable Telnet Client from the command line

This is quicker if you’re setting up several PCs or working on Windows Server. Right-click Start and open Terminal (Admin) (Windows PowerShell (Admin) on Windows 10). If you’re signed in as a standard user, see how to run a program as a different user.

In Command Prompt or PowerShell, use DISM:

dism /online /Enable-Feature /FeatureName:TelnetClient

Or, in PowerShell only:

Enable-WindowsOptionalFeature -Online -FeatureName TelnetClient

To check whether it’s already on, run dism /online /Get-FeatureInfo /FeatureName:TelnetClient and look at the State line. To remove it again, swap /Enable-Feature for /Disable-Feature.

You may see pkgmgr /iu:"TelnetClient" in older guides. That was the Windows 7-era method. Use DISM on current versions.

How to use telnet

Laptop showing lines of text, a reminder that telnet sends everything you type unencrypted

The basic syntax is:

telnet <host> [port]
  • <host> is a host name or IP address, such as 192.168.1.1 or mail.example.com.
  • [port] is optional. Without it, telnet uses port 23.
  • telnet on its own opens the interactive Microsoft Telnet> prompt, where you can type open host port.

Two optional switches are useful: /f filename saves a log of the session on your PC, and /l username sends a user name to servers that support it. For example: telnet /f telnetlog.txt 192.168.1.20 23.

To leave a session: press Ctrl + ] to go back to the Microsoft Telnet> prompt, then type quit and press Enter. The welcome text at the Microsoft Telnet> prompt names this escape key. Closing the window also ends the session.

Test whether a port is open

Network equipment with Ethernet cables, where telnet is often used to test whether a port is open

This is the most common reason to use telnet today. Run telnet with the host and the port you want to check:

telnet mail.example.com 25
What you seeWhat it means
The window clears to a blank screen with a cursor, or shows a greeting (banner) from the serviceThe port is open and something is listening.
“Could not open connection to the host, on port 25: Connect failed”Nothing answered. The service may be down, the port closed, or a firewall in the way.
A long pause, then the same failurePackets are probably being dropped by a firewall rather than refused.

If the name doesn’t resolve, try the IP address instead. If that works, the problem is name resolution, not the port. Our guide to fixing DNS errors on Windows covers the usual causes. If nothing on the network answers at all, check your own connection first, for example an Ethernet adapter without a valid IP configuration.

Remember that the test runs from your PC. A port can be open on the server but still blocked by your own firewall, your router or your company network.

Telnet prompt commands

At the Microsoft Telnet> prompt (or after pressing Ctrl + ] during a session) you can use these commands:

CommandWhat it does
open host [port]Connects to a host.
closeEnds the current connection but stays in telnet.
quitDisconnects and closes Telnet Client.
statusShows whether you’re connected.
displayShows the current settings.
set localechoShows what you type, useful when a server doesn’t echo it back. unset localecho turns it off.
set logfile nameSets a file to log the session to (use set logging to start logging).
set term vt100Changes the terminal type. Options are ansi, vt100, vt52 and vtnt.
send aytSends “Are you there?” to the server. send brk sends a break.
? or helpLists the commands.

While you’re at the prompt during a session, press Enter on an empty line to return to the session.

Test a port without telnet: Test-NetConnection

If you can’t or don’t want to install Telnet Client, PowerShell has a built-in port test. Open PowerShell (no admin needed) and run:

Test-NetConnection mail.example.com -Port 25

Look at the TcpTestSucceeded line: True means the port answered, False means it didn’t. The output also shows the IP address the name resolved to, which helps spot DNS problems. tnc is a short alias, and -CommonTCPPort accepts HTTP, RDP, SMB or WINRM instead of a number:

tnc 192.168.1.20 -CommonTCPPort RDP

Add -InformationLevel Quiet if you only want True or False, for example in a script.

Fix “telnet is not recognized”

The message “‘telnet’ is not recognized as an internal or external command” (or “The term ‘telnet’ is not recognized” in PowerShell) almost always means Telnet Client isn’t turned on yet.

  • Turn it on with Windows Features or DISM, as above.
  • Close and reopen Command Prompt or PowerShell, because windows that were already open may not find the new command.
  • Check the feature state with dism /online /Get-FeatureInfo /FeatureName:TelnetClient. It should say State : Enabled.
  • On a work PC, your IT department may block optional features. If the install fails, use Test-NetConnection instead, or ask them.

If DISM fails with a source or corruption error, repair Windows first with DISM /Online /Cleanup-Image /RestoreHealth and sfc /scannow, then try again.

Telnet server and remote logins: use SSH instead

Windows 11 and Windows 10 include only the telnet client. There’s no Telnet Server to switch on, and you shouldn’t want one: anyone on the network path can read a telnet session, including passwords.

  • To log in to Linux servers, routers or other Windows PCs, use ssh user@host. The OpenSSH Client is built into current versions of Windows 11 and 10. If ssh isn’t recognized, add OpenSSH Client under Optional features in Settings (under System or Apps, depending on your Windows version).
  • For a remote desktop, use Remote Desktop or a remote-support tool. If one keeps dropping, see fixing “Disconnected from the AnyDesk network”.
  • If a device only supports telnet, keep it on a separate, trusted network and don’t reuse that password anywhere else.

Official sources: for more detail, see these pages:

Frequently asked questions

Is telnet still available in Windows 11?

Yes. Telnet Client is still an optional feature in Windows 11 and Windows 10. It’s just off by default, so you have to turn it on once.

Do I need to restart after enabling telnet?

Usually not. Open a new Command Prompt or PowerShell window and it should work. Restart only if Windows asks.

Is it safe to turn on Telnet Client?

The client on its own doesn’t open any ports on your PC, so having it installed is low risk. The danger is typing passwords into a telnet session, because they’re sent unencrypted. Use SSH for logins.

How do I exit telnet?

Press Ctrl + ], type quit and press Enter. You can also just close the window.

What port does telnet use?

Port 23 by default. You can connect to any other TCP port by adding it after the host name, for example telnet example.com 443.

How we write our guides: read our editorial policy.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *