- 10 Useful Windows Networking Commands
- 1. Ping Command
- 2. ipconfig Command
- 3. Hostname Command
- 4. getmac Command
- 5. arp Command
- 6. NSlookup
- 7. Nbtstat
- 8 Net Command
- 9. Netstat Command
- 10. TaskKill Command
- Command Prompt (CMD) – 8 network commands you should know
- 1. How to check internet connection in CMD
- 2. How can I see all the network adapters on my computer using CMD?
- 3. How to check your network connection in CMD
- 4. How to renew the IP address of your network adapter
- 5. How to get nic info about your network adapter’s MAC addresses
- 6. How can I see the computers and devices connected to my network using CMD?
- 7. How can I see all the devices connected to my network using CMD?
- 8. How to check your computer’s network connections and open ports
- Do you know other useful ways to get cmd nic info?
- 15 Useful Windows Networking Commands You Should Know
- How to Access Command Prompt in Windows
- 1. PING
- Used for: Troubleshooting network connection issues
- 2. IPCONFIG
- Used for: Quickly finding your IP address
- 3. GETMAC
- Used for: Quickly finding your MAC address
- 4. ARP
- Used for: Troubleshooting network connection issues
- 5. HOSTNAME
- Used for: Quicking finding your hostname
- 6. NSLOOKUP
- Used for: Troubleshooting network connection issues
- 7. NBTSTAT
- Used for: Troubleshooting NetBIOS issues
- 8. NET
- Used for: Displaying available Net switches
- 9. NETSTAT
- Used for: Displaying network statistics
- 10. NETSH
- Used for: Displaying and configuring network adapters
- 11. TASKKILL
- Used for: Ending processes
- 12. TRACERT
- Used for: Troubleshooting network connection issues
- 13. PATHPING
- Used for: Troubleshooting network connection issues
- 14. SYSTEMINFO
- Used for: Displaying system information
- 15. NET VIEW
- Used for: Viewing devices connected to a network
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 216.58.208.68
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.
Command Prompt (CMD) – 8 network commands you should know
Command Prompt proved itself to be one of the best tools for running basic commands that allow you to work with files and folders from Windows. However, the Command Prompt is much more powerful than just that. You can take things to the next level by running more than just a few advanced commands, including a range of handy network commands. Today, we’re going to learn how to use Command Prompt to check the internet connection, the network connections, view information about network devices, and watch connections between your PC and other devices. Without further ado, let’s begin:
NOTE: We wrote this guide using Windows 10 with November 2019 Update. However, all the commands illustrated work the same way in Windows 8.1 and Windows 7. Before going any further, if you don’t know how to open the Command Prompt, read: 11 ways to launch the Command Prompt in Windows.
1. How to check internet connection in CMD
To check whether your internet connection works, you can use Command Prompt to test your connection to a certain website or internet location. To do that, you can use the ping network command, followed by a web address or IP address. For instance, you can check the connectivity to Digital Citizen without opening a web browser, by typing the command “ping www.digitalcitizen.life.” Then press Enter on your keyboard.
If the ping statistics don’t show any loss of packets, your internet connection is working as it should. However, if you get lost packets, that means that either your internet connection is broken, or that the website you pinged is not online. To double-check your internet connection, ping at least another website, preferably one that it’s always on, such as www.google.com.
The ping command also allows you to use the handy “-t” parameter, which enables you to ping the specified address forever until it’s manually stopped. For instance, we typed “ping -t www.digitalcitizen.life.” After some time, we wanted to see some connection statistics and we used the keyboard combination “CTRL + Break.” This shows the averages of the ping commands run until then.
Finally, we terminated the command by using the keyboard combination “CTRL + C.” This stops the endless cycle of ping commands to the specified address.
2. How can I see all the network adapters on my computer using CMD?
To obtain detailed information about your network adapters and connections, use the ipconfig command. Open Command Prompt, type ipconfig, and press Enter. As you can see in the screenshot below, when you run this command, Windows displays the list of all the active network devices, whether they’re connected or disconnected, and their IP addresses. You also get details such as their default gateway IP addresses, subnet masks and the state of each network adapter.
If you add the /all switch to the ipconfig command, you can get to a whole new level of detail: DNS information, the MAC (Media Access Control) (in the Physical Address field), and other information about each network component. Check out the picture below to see a sample of what you get from the “ipconfig /all” command.
3. How to check your network connection in CMD
If you want to check whether your network connection to the router is operating as it should, you can use a combination of the commands ipconfig and ping. First, get some cmd nic info about your adapter. In other words, open Command Prompt and run ipconfig. In the list of results, identify the network adapter that’s used for connecting to the network you want to test. Then, in its details, find the IP address of your router and note it down. For example, if we’d want to check our Ethernet network connection, we’d run ipconfig and see that our router’s IP address is 192.168.50.1.
The next step is to check that the network connection between the router and the computer is OK. To do that, it’s enough to run the ping command on the router’s IP address. In our example, that would mean that we have to run this command in CMD: ping 192.168.50.1.
If there are no packets lost, then the network connection tested is running well. Otherwise, there’s a problem somewhere between your computer and the router, in which case you should check that your PC’s network adapter is configured correctly, that the Ethernet cable is OK (if you’re using a wired connection), and that the router is configured properly.
4. How to renew the IP address of your network adapter
When your network connection doesn’t work as it should, your network adapter might not have the right IP address assigned. A quick way of trying to solve this issue is to renew its IP address and, fortunately, you can do that quickly, straight from the Command Prompt. Open CMD and run the following commands: ipconfig /release and ipconfig /renew. The first one (ipconfig /release) forces your network adapter to drop its assigned IP address, and the second command (ipconfig /renew) renews the network adapter’s IP address.
Note that you can also instruct CMD to run both commands in one line by typing “ipconfig /release & ipconfig /renew,” without the inverted quotation marks. If you type them like this, Command Prompt executes the first command and, when it’s done, it automatically runs the second one. Cool, right? 🙂
The release and renew parameters are useful in networks that use DHCP (Dynamic Host Configuration Protocol) to distribute IP addresses automatically. Your system gives up its current address and requests a new one from the DHCP server, and that can help you troubleshoot certain network issues.
5. How to get nic info about your network adapter’s MAC addresses
One of the fastest and easiest ways to obtain the MAC addresses of your network adapters is to use the getmac command. In Command Prompt, type getmac and press Enter, as seen in the image below.
6. How can I see the computers and devices connected to my network using CMD?
In some cases, you might want to see what computers and devices are connected to the same network as you are. One of the easy and friendly ways to do that is to use the net view command. Launch Command Prompt and run net view. After a while, you should see a list of the computers and devices in your network.
However, there’s a caveat about this command. Net view doesn’t show all the computers and devices that are in the same network as you. Although it works well enough for private networks, it fails to identify devices such as smartphones or printers, and also has issues with computers that are running different operating systems. If you want to get a clear view of everything that’s connected to your network, you should also check the next command.
7. How can I see all the devices connected to my network using CMD?
The best way to find all the devices connected to the same network as you is based on using the arp command. Open Command Prompt and run arp -a. The IP address shown first, next to Interface, displays your network adapter’s IP address. Then, there’s a list of IP addresses and MAC addresses (Physical Addresses). All the IP addresses that start with the same numbers as your network adapter are in the same network and/or subnet as you are. They are all devices connected to your network.
The next ones are not real devices, but IP addresses used for multicasting. They are commonly used by your real devices for streaming media on your network. In our example, the devices connected to the same network as our computer are all the ones that have IP addresses starting with 192.168.50.
If you want to see what those devices are, in a more human-friendly way, copy their MAC addresses and look them up on the internet using Google or on websites that let you check which vendors assign certain MAC addresses, such as DNS Checker. For instance, if you’re looking for the MAC address 04-d9-f5-b5-b1-f0, you find that it’s a device made by ASUS. In truth, it’s an ASUS ZenWiFi router.
8. How to check your computer’s network connections and open ports
You can get other useful cmd nic info from the netstat command, which lets you see the network connections that are active between your system and any other systems on your network or the internet.
If you add the -a parameter to the netstat command, you can get a list with all the connections and listening ports, as seen in the image below.
Do you know other useful ways to get cmd nic info?
The networking commands that you can run in the Command Prompt can be useful when you need to find information about devices connected to your network or when you want to test your network connections state. They’re convenient also when you have networking issues, and you’re trying to troubleshoot them by yourself. If you have questions about these networking commands, if you need help, or if you want us to add others to the list, leave us a comment below.
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
1. PING
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.
2. IPCONFIG
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
3. GETMAC
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.
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.
5. HOSTNAME
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.
6. NSLOOKUP
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.
7. NBTSTAT
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.
9. NETSTAT
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.
10. NETSH
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 /?
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.
11. TASKKILL
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 /? .
12. TRACERT
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.
13. PATHPING
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.
14. SYSTEMINFO
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.
15. NET VIEW
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.