My IP Ports
SYSADMIN & DEVELOPER REFERENCE

How to Check Open Listening Ports on Windows, Linux, & macOS

Before setting up router port forwarding or debugging external connectivity, you must confirm your service is actively bound to the socket and listening on the wildcard interface. Here is how to find open ports across all major operating systems.

The #1 Port Forwarding Mistake: Localhost vs Wildcard Binding

When an external port test fails with CLOSED (ECONNREFUSED), over 80% of the time the issue is not the router—it is the application's local IP binding:

127.0.0.1 (Loopback Only)

Accepts packets originating strictly from the local computer. Any packet forwarded by your router across the LAN is immediately dropped with an RST packet by your operating system kernel.

0.0.0.0 or [::] (All Interfaces)

Binds to all local network adapters, including your machine's private LAN IP (e.g. 192.168.1.50). This allows incoming forwarded router packets to reach the listening application.

Select Your Operating System

Click OS to view native commands

Windows (PowerShell & Command Prompt)

Modern Windows 10, 11, and Windows Server feature native PowerShell cmdlets to inspect TCP states without parsing strings:

PowerShell: List All Listening Ports & PIDs powershell
Get-NetTCPConnection -State Listen | Select-Object LocalAddress, LocalPort, OwningProcess | Sort-Object LocalPort

Displays all open listening ports sorted numerically alongside their process IDs (OwningProcess).

To find the specific executable name associated with the process ID (e.g. PID 1420):

PowerShell: Resolve Process Name from PID powershell
Get-Process -Id 1420

Replace 1420 with your OwningProcess PID to identify the program.

Classic CMD / Command Prompt Fallback:
CMD: Netstat Filter cmd
netstat -ano | findstr LISTENING

The -a flag lists all connections, -n keeps numbers numerical, and -o lists the owner process ID.

4-Step Port Forwarding Verification Checklist

1
Verify Service is Running & Listening

Run the OS command above. If your port number does not appear in the command output at all, the application is stopped, crashed, or still initializing.

2
Check Binding: Reconfigure from 127.0.0.1 to 0.0.0.0

If the socket shows 127.0.0.1, edit your server configuration:

• Node.js / Express: app.listen(PORT, '0.0.0.0')
• Python / Uvicorn: uvicorn.run(app, host='0.0.0.0', port=PORT)
• Minecraft: In server.properties, keep server-ip= completely blank
• PostgreSQL: In postgresql.conf, set listen_addresses = '*'
3
Test Local Loopback Handshake

Confirm your application responds locally before touching router settings:

curl -I http://localhost:PORT
4
Test Public WAN Reachability on onmyport.com

Testing your public IP from inside your home network often fails due to lack of NAT Loopback (Hairpin NAT) support on consumer routers. Use onmyport.com's external edge servers to probe your actual public reachability.

Ready to verify external reachability? Find your public IP and initiate an edge TCP socket probe.