The netstat command is used to display the TCP/IP network protocol statistics and information.

Availability

Netstat is an external command available for the following Microsoft operating systems as netstat.exe.

  • Availability

  • Netstat syntax

  • Netstat examples

  • Windows 95

  • Windows 98

  • Windows NT

  • Windows ME

  • Windows 2000

  • Windows XP

  • Windows Vista

  • Windows 7

  • Windows 8

  • Windows 10

  • Windows 11

Netstat syntax

Windows 11 syntax

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

Windows Vista, 7, 8, and 10 syntax

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

Windows XP and earlier syntax

NETSTAT [-a] [-e] [-n] [-s] [-p proto] [-r] [interval]

Netstat examples

netstat

Displays all local network information. Below is an example of how this may look.

  • Windows 11 syntax.
  • Windows Vista, 7, 8, and 10 syntax.
  • Windows XP and earlier syntax.

If you have network applications open, such as the Internet browser you are using to view this page, additional items are listed when running “netstat” and the “netstat -a” command. So you may see items from Computer Hope in your list. If you want a true listing of background Internet connections, close all programs and run the command. It is also normal to see one or more 0.0.0.0 and 127.0.0.1 addresses.

Proto Local Address Foreign Address StateTCP hope:4409 www.computerhope.com:telnet ESTABLISHEDTCP hope:3708 multicity.com:80 CLOSE_WAITTCP hope:4750 www.google.com:80 CLOSE_WAIT

netstat -an

Displays all connections on the computers in numerical format, only displaying the local and foreign IP addresses.

netstat 5

Running netstat with a number after the command continues to run the command until stopped. In this case, netstat would be refreshed every five seconds. To cancel, press Ctrl+C.

  • How to use ping, winipcfg, and other network commands.