What is Netstat? How to Use it in Windows 10?

Network Statistics (netstat)

Netstat is a command-line network information and troubleshooting utility tool. In the Windows operating system, it can be found with the file name NETSTAT.EXE. Netstat can be launched by typing and entering the command netstat in the Command Prompt.

There are various Switches that can be used with the netstat command to display different types of networking related data. For example the switch –a lists all of the TCP/IP connections and listening ports.

You can use these Switches either one at a time, or in combination with others to get more information using only one command.

Syntax: netstat –switchname(s)

Most of the netstat commands can be run without administrative privileges, but there are some that require elevated permissions.

Find Supported Switches

If you type netstat without any switches then it does its default job, which is listing currently open network connections. On the other hand, if you want to know about all of the supported switches, type netstat /?, and press Enter.

Here are the names of all the switches that can be used with the netstat command.

NETSTAT [-a] [-b] [-e] [-f] [-n] [-o] [-p proto] [-r] [-s] [-x] [-t] [interval]

How to Use Netstat in Windows 10

Example 1: netstat –a

Example 2: netstat –ano

As you can see the first example uses only one switch whereas the second one uses a combination of three switches.

Example 1

Step 1: Press Windows + X keys together to open the Windows Super User Menu. Click on the Command Prompt (Admin) option to open Command Prompt with Administrative privileges.

Step 2: In the Command Prompt window, type netstat followed by a switch name. In this example, we’ll use –a. Press the Enter key. The switch –a displays all of the connections and their listening ports.

Step 3: The Command Prompt displays all of the ESTABLISHED network connections.

Example 2

Step 1: Open Command Prompt with Administrative privileges.

Step 2: In the Command Prompt window, type netstat –ano. Press the Enter key.

Step 3: This time, we get some additional information because of the additional multiple switches. Now, the Command Prompt displays all of the ESTABLISHED network connections as well as the PID (Program Identifier) of each process.

Export Netstat Data to a Text file

Step 1: Open Command Prompt with Administrative privileges.

Step 2: In the Command Prompt window, type the netstat command followed by the location of the drive and the file name. For example, type netstat –ano>c:netstat.txt. In this command, c: is the drive, and netstat.txt is the file used to store data the obtained by running this command.

Press the Enter key.

Step 3: Now, open your C: drive; you’ll find a file with the name netstat.txt.

That’s how you can use the netstat command to get detailed information about your network connections.

Monitor Network Traffic Using Netstat in Windows 10

Detect Malware (Viruses) Using Netstat in Windows 10

Leave a comment