All network commands windows

10 Useful Windows Networking Commands

Windows has some very useful networking utilities that are accessed from a command line (cmd console).

On Windows 10 type cmd in the search box to open a command console.

The networking commands are mainly used for getting system information and troubleshooting networking problems.

Here we look at the 10 commands that I use most often.

1. Ping Command

The ping command is one of the most often used networking utilities for detecting devices on a network and for troubleshooting network problems.

When you ping a device you send that device a short message, which it then sends back (the echo).

The general format is ping hostname or ping IPaddress.

ping www.google.com or ping

This article covers the ping command in more detail

2. ipconfig Command

Another indispensable and frequently used utility that is used for finding network information about your local machine like IP addresses, DNS addresses etc

Basic Use: Finding Your IP Address and Default Gateway

Type the command ipconfig at the prompt.

The following is displayed

Ip config has a number of switches the most common are:

ipconfig /all – displays more information about the network setup on your systems including the MAC address.

ipconfig /release – release the current IP address

ipconfig /renew – renew IP address

ipconfig /? -shows help

ipconfig/flushdns – flush the dns cache

3. Hostname Command

A very simple command that displays the host name of your machine. This is much quicker than going to the control panel>system route.

4. getmac Command

Another very simple command that shows the MAC address of your network interfaces

5. arp Command

This is used for showing the address resolution cache. This command must be used with a command line switch arp -a is the most common.

Type arp at the command line to see all available options.

6. NSlookup

Used for checking DNS record entries. See Using NSlookup for more details

7. Nbtstat

Diagnostic tool for troubleshooting netBIOS problems. See This technet article.

8 Net Command

Used for managing users,service,shares etc see here

9. Netstat Command

Used for displaying information about tcp and udp connections and ports. See tcp and udp ports and sockets and how to use the netstat command

10. TaskKill Command

View a list of running tasks using the tasklist command and kill them by name or processor ID using the taskKill command- See this tutorial.

Windows Network Commands for TCP/IP

PING: Test the network connection with a remote IP address

The -t option to ping continuously until Ctrl-C is pressed.
If you specify the -t option you can always get statistics without interrupting pings by pressing Ctrl + Break

This command is also useful to generate network load by specifying the size of the packet with the -l option and the packet size in bytes.


TRACERT: Displays all intermediate IP addresses through which a packet passes through, between the local machine and the specified IP address.

This command is useful if the ping command does return any data, to determine at what level the connection failed.


IPCONFIG: Displays or refresh the TCP/IP configuration

This command, when executed with no options, displays the current IP address, the subnet mask and default gateway (network interfaces of the local machine)

  • /all: Displays all network configuration, including DNS, WINS, DHCP servers, etc .
  • /renew [adapter]: Renews DHCP configuration for all adapters (if adapter is not specified) or a specific adapter indicated by the [adapter] parameter.
  • /release [adapter]: Sends a DHCPRELEASE message to the DHCP server to release the current DHCP configuration and cancel the IP address configuration for all adapters (if adapter is not specified) or a specific adapter indicated by the [adapter] parameter. This parameter disables TCP/IP for network cards configured to automatically obtain an IP address.
  • /flushdns: Empty and reset the DNS client resolver cache. This option is useful to exclude negative entries and all other entries added dynamically to the cache.
  • /displaydns: Displays the DNS client resolver cache, which includes entries preloaded from the local host file and any recently obtained records for name queries resolved by the host computer. The DNS Client service uses this information to quickly resolve frequently queried names, before querying the configured DNS servers.
  • /registerdns: Refreshes all DHCP leases and re-registers DNS names.



ARP: Resolving IP addresses to MAC addresses. Displays and modifies the translation tables of IP addresses to physical addresses used by the ARP address resolution protocol.

  • -a Displays active ARP entries by interrogating the current data protocol. If adr_inet is specified, only the physical and IP addresses of the specified computer are displayed. If more than one network interface uses ARP, entries for each ARP table are displayed.
  • -g is the same as -a
  • adr_inet Specifies an internet address.
  • -N adr_if Displays ARP entries for the network interface specified by adr_if.
  • -d Deletes the host specified by adr_inet.
  • -s Adds the host and associates the adr_inet internet address with the adr_eth physical address. The physical address is given as 6 hexadecimal bytes separated by hyphens. The entry is permanent.
  • adr_eth Specifies a physical address.
  • adr_if Specifies the internet interface whose address translation table should be modified. When not specified, the first applicable interface will be used.
Читайте также:  You will be able to manage your windows settings перевод


NBTSTAT: Update cache of the LMHOSTS file. Displays protocol statistics and current TCP/IP connections using NBT (NetBIOS over TCP/IP).

-a (adapter status) display the table (names) of the remote machine (known name).
-A (adapter status) display the table (names) of the remote machine (IP address).
-c (cache) display the remote name cache including the IP addresses.
-n (names) Lists local NetBIOS names.
-r (resolved) Lists names resolved by broadcast and via WINS.
-R (Reload) Clear and reload the table cache with the remote names.
-S (Sessions) Lists the sessions table with the destination IP addresses.
-s (sessions) Lists the sessions table with the destination IP addresses converted to host names via the hosts file.
Example :
nbtstat -A @IP
This command returns the NetBIOS name, system name, users connected . to the remote machine.


The telnet command to access to a remote host in Terminal mode (passive screen) . It also allows you to check if any TCP service is running on a remote server by specifying the IP address after the TCP port number. Thus we can test whether the SMTP Service is running on a Microsoft Exchange server, using the IP address of the SMTP connector, and then 25 as the port number. The most common ports are:

  • ftp (21),
  • telnet (23),
  • smtp (25),
  • www (80),
  • kerberos (88),
  • pop3 (110),
  • nntp (119)
  • and nbt (137-139).



Nslookup sends DNS requests to a DNS server

The nslookup command to send DNS requests to a server. By default, if you do not specify the DNS server, the command will use the one that is configured for your network interface (the one you use to surf the internet, for example).

15 Useful Windows Networking Commands You Should Know

Affiliate Disclosure: As an Amazon Associate I earn from qualifying purchases.

Windows comes with some incredibly useful networking commands that are powerful, yet very easy to use and access from the command prompt, also referred to as cmd.

Here are 15 of the most useful networking commands available in Windows you should know about to make gathering information, identifying issues and fixing problems much easier and quicker.

How to Access Command Prompt in Windows

1. Right-click on the Start button and select Run to open the Run window

2. Type cmd into the field and click on OK

3. The Command Prompt window will open


Used for: Troubleshooting network connection issues

Command to enter: ping

The ping command is one you are likely to be familiar with as it is one of the most widely used utilities, but it is still essential nonetheless.

Ping is used to test whether one network host is able to communicate with another.

Assuming there is nothing in place to stop the ping reaching its destination, like a firewall or a network problem, the device will respond to the ping with four data packets.

If you receive these packets back, the ping confirms that a working network path exists between you and the destination host.

I have a dedicated article on how to use the ping command that goes into this essential command in greater detail.


Used for: Quickly finding your IP address

Command to enter: ipconfig

IPConfig is one command I find myself using a great deal as it can provide you with a lot of useful information from just the one command.

Simply, the IPConfig command displays basic IP address configuration information for the Windows device you are working on.

IPConfig has a few switches associated with it to provide additional information as well as perform certain actions:

  • IPConfig /all – Displays additional information for all network adapters
  • IPConfig /release – Releases the IP address you are currently using
  • IPConfig /renew – Renews an IP address on your device
  • IPConfig /flushdns – Flushes the DNS cache
  • IPConfig /? – Displays help for IPConfig and its switches


Used for: Quickly finding your MAC address

Command to enter: getmac

In order to be compliant with the IEEE 802 standards, each device must have a unique MAC (Media Access Control) address.

The manufacturer of your device will assign it a MAC address and store it within the hardware.

The getmac command provides an easy way to find the MAC address of your device. If you see more than one MAC address for your device, it will have multiple network adapters. As an example, a laptop with both Ethernet and Wi-Fi will have two separate MAC addresses.

Читайте также:  Asus x5ms драйвера windows 10

Some administrators will use the unique MAC addresses of devices to limit what can and cannot connect to a network.

4. ARP

Used for: Troubleshooting network connection issues

Command to enter: arp

ARP stands for Address Resolution Protocol and the command is used to map an IP address to a MAC address.

It is easy to assume that communication over a network takes place using just IP addresses, but this is not the case. The delivery of packets is ultimately dependent on the MAC address of the device’s network adapter, not the IP address.

By using the arp command, you can display and modify the Address Resolution Protocol cache; useful for resolving address resolution problems.


Used for: Quicking finding your hostname

Command to enter: hostname

The hostname command provides you with an easy way of identifying the hostname that has been assigned to your Windows device.

There are ways of being able to find this through Windows, but using the command line is much quicker.

Simply type hostname into the command prompt and it will present you with the local computer name of your device.


Used for: Troubleshooting network connection issues

Command to enter: nslookup

NSLookup is useful for diagnosing DNS name resolution problems.

By typing nslooku p into the command prompt, you will be presented with the name and IP address of your device’s DNS server.

For you at home, this will more than likely be your router, but in enterprise environments, this will probably be a dedicated DNS server.

NSLookup can be used to find the IP address of a device, find the domain name of an IP address and find mail servers for a domain.


Used for: Troubleshooting NetBIOS issues

Command to enter: nbstat

As you now know from using the hostname command, each device running Windows will be assigned a computer name.

Often, there will be either a domain or workgroup that is also assigned and that the device is a member of. For you at home, your device is likely to be within its own workgroup.

The technical term for the computer name is the NetBIOS name, which is where the nbtstat command comes into play.

Windows uses different methods to associate NetBIOS names with IP addresses; these include broadcast and LMHost lookup.

There are times in which this mapping breaks down, so the nbtstat command is used to help you diagnose and resolve these problems.

Nbtstat -n will show the NetBIOS names that are in use by a device, whereas the nbtstat -r command shows how many NetBIOS names a device has recently been able to resolve.

8. NET

Used for: Displaying available Net switches

Command to enter: net

The net command is definitely a versatile one, allowing you to manage many different aspects of a network and its settings such as network shares, users and print jobs, as just a few examples.

Running just net won’t do much, but it will present you with a list of all the switches that are available.

These include accounts to set password and logon requirements, file to show a list of open files and sessions to list, or even disconnect, sessions on the network.

If you are ever in doubt as to what task each switch performs, run net help and I’m sure you’ll find the answer.


Used for: Displaying network statistics

Command to enter: netstat

Viewing network statistics is a great way to troubleshoot any problems you are experiencing on your network and may well point you in the direction of the root cause.

The netstat command does just that; present you with a useful network summary for your device.

Run netstat and you’ll see a list of active connections, with more being added every few seconds. It will describe the protocol being used, the local address, the foreign address, and the connections state.

To see some interface statistics including bytes sent and received, errors sent and received, and unknown protocols use the netstat -e switch.


Used for: Displaying and configuring network adapters

Command to enter: netsh

Netsh is another very powerful command, allowing you to view and configure almost all of the network adapters in your device in much greater detail compared with some other commands.

When you run the netsh command on its own, the command prompt will be shifted into network shell mode. Within this mode, there are several different “contexts”, such as one for DHCP-related commands, one for diagnostics and one for routing.

It is possible to still run individual commands from netsh , though.

In order to see all of the available netsh contexts, run netsh /?

To see all of the commands available within a context, run netsh contextname /?

Читайте также:  Windows 10 get windows apple

Subcommands are available within certain commands. To view these, run netsh contextname show /?

As an example, you can run the netsh wlan show drivers command to view all of the wireless network drivers on your device and their properties.


Used for: Ending processes

Command to enter: taskkill

I’m sure you are familiar with being able to end a process using the Task Manager, but did you know it is also possible from the command line?

Well, you certainly can, and you have the option to kill a task or process using either the process ID or by the file name.

If you aren’t sure of which processes are running and therefore don’t know what needs to be killed, first use the tasklist command to see the process name (listed as the image name) in addition to how much memory that process is using.

Once you know the process name, you can use taskkill /IM processname.exe to end it.

In some cases, using just the taskkill command is not enough and we need to forcibly stop a process. An example being if we try and kill Internet Explorer when we have multiple tabs open. In this case, you can use the taskkill /f /IM iexplore.exe to forcibly kill the process.

There are many different switches available for the taskkill command. To view them all, run taskkill /? .


Used for: Troubleshooting network connection issues

Command to enter: tracert

By using the tracert command you can trace the route a packet takes before reaching its destination, and see information on each “hop” along the route.

A hop refers to the number of routers that a packet passes through along its route. Sometimes a hop is counted when the packet passes through other pieces of networking hardware, such as repeaters, switches, and access points, but this isn’t always the case as it depends on how these devices are configured and the role they play on the network.

After running the tracert command, you will be presented with a line by line summary of each hop which includes the latency between your device and that particular hop and the IP address of the hop.

Let’s say you run the ping command to test the reachability of a website. In this example, you do not receive a reply so the site cannot be contacted.

You can then use the tracert command to show you exactly where the problem is occurring. It could be a fault at your end, or the website itself may be unavailable.


Used for: Troubleshooting network connection issues

Command to enter: pathping

We have already described the ping and tracert commands and the similarities between the two.

As you have probably already guessed by the name of the command, pathping combines that best of both ping and tracert into a single utility.

Enter pathping followed by a hostname into the command prompt and it will initiate what looks like a regular old tracert command.

Let the process finish, however, and you will be provided with more detail than either pin g or tracert can provide, such as latency reports and statistics on packet loss.

Be patient when using the pathping command as it will take five minutes in order to gather all of the statistics for you.


Used for: Displaying system information

Command to enter: systeminfo

If you need to know anything about the device you are using, be it details of the processor used, the version of Windows you are operating on, or what the boot device is configured as, you can find it all through the Windows GUI.

But why would you want to spend time doing that when you can run this simple command to see it all in one place?

This command will poll your device and display the most important information in a clean, easy to read format.


Used for: Viewing devices connected to a network

Command to enter: net view

There may be a time where you want to see what devices are connected to your network. This is where the net view command comes in.

Simply run the net view command and after a short while you will be presented with a list of devices that are connected to the same network as you.

The caveat with this command is that it may not show all of the devices connected to your network.

It works well enough for private networks but will fail to identify devices such as smartphones and printers, and it can have trouble identifying devices running a different operating system to Windows.

This simple command may work perfectly for you and your home network, but if not, you can always use the arp command we discussed earlier instead.