In this article, you will find how to check open ports using command prompt. Checking open ports on your Windows system can help recognize network issues, test firewall configurations, and monitor active connections.
Follow the steps:
- Open Command Prompt:
- Check for open ports using netstat:
Use the netstat command with suitable flags to view open ports:netstat -an | find “LISTEN”
Explanation:
- netstat: Shows network connections and listening ports.
- -a: Displays all connections and listening ports.
- -n: Displays addresses and port numbers in numeric form.
- find “LISTEN”: Filters the output to show only listening ports.
You’ll see output like:TCP 0.0.0.0:80 0.0.0.0:0 LISTENING TCP 127.0.0.1:3306 0.0.0.0:0 LISTENING
This means ports 80 and 3306 are open and listening.
- Find the application using the Port
- To classify which application is using a specific port, use:
netstat -aon | findstr :<port_number>
For example:
netstat -aon | findstr :80
- The output will show a PID (Process ID). To find the application:
tasklist /FI “PID eq <pid_number>”
Example:
tasklist /FI “PID eq 1234”
This will display the process using that port.
- To classify which application is using a specific port, use:
Optional: Use PowerShell Alternative
You can also use PowerShell with this command:
Get-NetTCPConnection | Where-Object {$_.State -eq “Listen”}
Useful Tip:
If you doubt a firewall is blocking a port, ensure it is allowed through Windows Defender Firewall:
- Go to Control Panel > Windows Defender Firewall > Advanced Settings.
- Create an Inbound Rule for the specific port if required.
If you need help examining open ports or troubleshooting network issues, feel free to reach out to our support team.
Complete your Linux network setup! Check out How to add additional SMTP ports