How can I tell if a specific port is in use?

As noted elsewhere: use netstat, with appropriate switches, and then filter the results with find[str]

Most basic:

netstat -an | find ":N"

or

netstat -a -n | find ":N"

To find a foreign port you could use:

netstat -an | findstr ":N[^:]*$"

To find a local port you might use:

netstat -an | findstr ":N.*:[^:]*$"

Where N is the port number you are interested in.

-n ensures all ports will be numerical, i.e. not returned as translated to service names.

-a will ensure you search all connections (TCP, UDP, listening...)

In the find string you must include the colon, as the port qualifier, otherwise the number may match either local or foreign addresses.

You can further narrow narrow the search using other netstat switches as necessary...

Further reading (^0^)

netstat /?

find /?

findstr /?

I am using Windows XP pro, and I need to know if something is registered on a port.

If so how can I tell what is on the port?

EDIT

What I mean by registered is that I am trying to test a .NET remoting application, and I need to see if the application is running or registered on a given port.

asked May 1, 2009 at 19:21

David BasarabDavid Basarab

1,1575 gold badges16 silver badges20 bronze badges

netstat -a -b will show all listening ports and the executable name (rather than just the PID).

If you prefer a graphical version, Microsoft's TCPView will show you the same information, updating in real-time.

answered May 1, 2009 at 19:31

Stephen JenningsStephen Jennings

1,3933 gold badges23 silver badges30 bronze badges

3

TCPview from the Sysinternals Suite does it in a nice, GUI way.

It includes a configurable update interval, address resolving and difference highlighting. And it is a lot faster than netstat -a -b.

Also available as a command line version (tcpvcon.exe). Both are free.

answered May 1, 2009 at 19:45

TomalakTomalak

1,6054 gold badges17 silver badges32 bronze badges

2

Run netstat from the command line and it will show you all of the current connections. netstat -b will show you what program is using the port.

answered May 1, 2009 at 19:31

jeffl8njeffl8n

4514 silver badges7 bronze badges

How do you define "registered"?

Anyway, netstat -o will list the currently used and listening ports with PIDs and tasklist (or whatever process id lister is available) would sort the process name and executable out I guess? ^^

edit: Oh nice, didn't notice the netstat -b option - that's obviously the better option :)

answered May 1, 2009 at 19:24

Oskar DuvebornOskar Duveborn

10.7k3 gold badges32 silver badges48 bronze badges

Download Article

Download Article

Are you looking for a quick way to check if a port on your router or firewall is open? It's actually pretty simple. The right way to do it just depends on whether you’re using a Mac or PC and what kind of port you’re checking. We’ll walk you through how to do it step-by-step on Windows and macOS.

  1. How can I tell if a specific port is in use?

    1

    Enable Telnet for Windows. You can use Telnet to check if a certain port is open on your local router or access point. Here's how to enable it:

    • Type windows features in to the search bar. If you don't see the search bar, click the circle or magnifying glass to the right of the Start menu.
    • Click Turn Windows features on or off.
    • Check the box next to Telnet Client and click OK.
    • Click Close when the app is finished installing.

  2. 2

    Open a command prompt. Here's how to open the command prompt:

    • Type cmd into the Windows search bar.
    • Click Command prompt in the search results.

    Advertisement

  3. How can I tell if a specific port is in use?

    3

    Type ipconfig at the prompt and press Enter. This displays a bunch of network information.

  4. How can I tell if a specific port is in use?

    4

    Write down the router's IP address. The address that appears next to "Default Gateway" in the ipconfig results is the local address of your router.

  5. How can I tell if a specific port is in use?

    5

    Type telnet at the prompt and press Enter. This opens the Microsoft Telnet prompt.

  6. How can I tell if a specific port is in use?

    6

    Type open (router's IP address) (port number). For example, if you wanted to see if port 25 is open on your router, and your router's IP address is 10.0.0.1, you would type open 10.0.0.1 25.

  7. 7

    Press Enter. Telnet will try to connect to the port.

    • If you see a message that says "Please press Enter" or "Press any key to continue," the port is open.
    • If you see a message that says "Could not open connection," the port is not open.

  8. Advertisement

  1. 1

    Open a Terminal window. To open a Terminal window, open Spotlight by clicking the magnifying glass at the top-right corner of the screen, type terminal, and then click Terminal in the search results.

    • Use this method to see if a port is open on your local router or access point.

  2. How can I tell if a specific port is in use?

    2

    Type netstat -nr | grep default at the prompt and press Return. The router's IP address appears next to "default" at the top of the results.

  3. How can I tell if a specific port is in use?

    3

    Type nc -vz (your router's IP address) (port). For example, if you wanted to see if port 25 is open on your router, and your router's IP address is 10.0.0.1, you would type nc -vz 10.0.0.1 25.[1]

  4. How can I tell if a specific port is in use?

    4

    Press Return. Here's how to interpret the results:[2]

    • If the port is open, you'll see a message that says the connection succeeded.
    • If the port is closed, you'll see a message that says the connection was refused or timed out.

  5. Advertisement

  1. 1

    Open Windows search and type firewall. If the search bar is not already open, click the circle or magnifying glass to the right of the Start menu to open it.

    • Use this method if you want to see if Windows is set up to allow an app you've installed to communicate through your firewall.
    • The Windows firewall is enabled by default. If you've installed your own firewall software, use that software to check if an app is allowed through.

  2. How can I tell if a specific port is in use?

    2

    Click Windows Defender Firewall. This opens your Firewall and Network Protection settings.

  3. How can I tell if a specific port is in use?

    3

    Click Allow an app through firewall. It's one of the text links near the bottom of the window. A list of apps allowed through the firewall will appear.

    • If the app is allowed through the firewall only when you're connected to a network you've marked as "private" (such as when you're on your home network), a check will appear in the "Private" column next to the app.
    • If the app is allowed through the firewall when you're connected to a public network, a check will appear in the "Public" column.

  4. 4

    Allow an unlisted app or port through the firewall. If you don't see the app on the "Allowed apps and features" list, click the Change Settings button at the top-right corner, and then follow these steps:

    • Click Allow another app near the bottom.
    • Click Browse, select the app, and then click Open.
    • Click Network Types near the bottom-left corner, select a privacy preference, and then click OK.
    • Click Add to add the app, and then click OK.

  5. Advertisement

  1. How can I tell if a specific port is in use?

    1

    Go to http://www.canyouseeme.org in a web browser. You can use it to see if a port on your computer or network is accessible on the internet. The website will automatically detect your IP address and display it in the "Your IP" box.[3]

    • There are many different sites you can use to check for an open port. Search for "open port check tool" in your favorite search engine to find an alternative, if desired.

  2. 2

    Enter the port. Type the port you want to check (e.g., 22 for SSH) into the "Port to Check" box.[4]

  3. 3

    Click Check Port. If the port is open and available, you'll see a confirmation message. If not, you'll see a message that says "Error: I could not see your service on (your IP address) on port (the port number)."[5]

  4. Advertisement

  1. How can I tell if a specific port is in use?

    1

    Click the

    How can I tell if a specific port is in use?

    menu and select System Preferences. The Mac firewall is not enabled by default.[6]

  2. How can I tell if a specific port is in use?

    2

    Click Security & Privacy. It's the house icon on the top row.

  3. 3

    Click the Firewall tab. It's near the top-center part of the window.

    • If you see the message "Firewall:On" near the top of the tab, this means your firewall is active.
    • If the firewall is not active but you want it to be, click the padlock icon at the bottom-left part of the window, enter your administrator password, and then click Turn On Firewall.

  4. 4

    Click Firewall Options. This opens your settings, including a list of apps and services set to either allow or disallow incoming connections.

    • If an app or service has a green dot and the text "Allow incoming connections," that means its port is open.
    • If you see a red dot that says "Block incoming connections," the port is closed.
    • You can toggle whether a port is allowed or not allowed by clicking the double-arrow icon next to the app's current status, and choosing an option.

  5. Advertisement

Add New Question

  • Question

    How do I check if a port is open Windows 10?

    How can I tell if a specific port is in use?

    Luigi Oppido is the Owner and Operator of Pleasure Point Computers in Santa Cruz, California. Luigi has over 25 years of experience in general computer repair, data recovery, virus removal, and upgrades. He is also the host of the Computer Man Show! broadcasted on KSQD covering central California for over two years.

    How can I tell if a specific port is in use?

    Computer & Tech Specialist

    Expert Answer

    An easy way to do this is to go to canyouseeme.org and type in the port number into the webpage. It'll be able to tell you whether or not the port is open.

Ask a Question

200 characters left

Include your email address to get a message when this question is answered.

Submit

Advertisement

About This Article

Thanks to all authors for creating a page that has been read 483,249 times.

Is this article up to date?

How can I tell if port 8080 is being used?

Use the Windows netstat command to identify which applications are using port 8080:.
Hold down the Windows key and press the R key to open the Run dialog..
Type “cmd” and click OK in the Run dialog..
Verify the Command Prompt opens..
Type “netstat -a -n -o | find "8080"". A list of processes using port 8080 are displayed..

How can I tell if a port is not in use?

You can use "netstat" to check whether a port is available or not. Use the netstat -anp | find "port number" command to find whether a port is occupied by an another process or not. If it is occupied by an another process, it will show the process id of that process.

How can I tell if a port is exposed?

How to check if port is in use in.
Open a terminal application i.e. shell prompt..
Run any one of the following command on Linux to see open ports: $ sudo lsof -i -P -n | grep LISTEN. $ sudo netstat -tulpn | grep LISTEN. $ sudo ss -tulpn | grep LISTEN. ... .
For the latest version of Linux use the ss command. For example, ss -tulw..

How can I tell who is using a port?

How to check which application is using which port.
Open the command prompt - start >> run >> cmd or start >> All Programs >> Accessories >> Command Prompt..
Type netstat -aon | findstr '[port_number]' . ... .
If the port is being used by any application, then that application's detail will be shown..