- 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
- The Best Windows Command Line Network Commands
- A Refresher on TCP/IP
- Learning to Love the Command Line
- What is Netstat?
- Important Netstat Commands
- What is Tracert?
- Important Tracert Commands
- What is IPconfig?
- Important IPconfig Commands
- What is NSLookup?
- Important NSLookup Commands
- 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?
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.
The Best Windows Command Line Network Commands
So that you can TC/IP freely
Windows comes packed with several useful network utilities. These programs can get you critical information about your network connection and help diagnose problems. There are four TCP/IP network utilities that every Windows user should know about:
Let’s see what these utilities do and how they’re commonly used.
A Refresher on TCP/IP
All four utilities are TCP/IP network programs. What does that mean?
TCP/IP is short for Transmission Control Protocol Internet Protocol. A protocol is a set of rules and specifications that determine how a process works.
For example, at work it might be protocol to first make an appointment with your boss’ personal assistant instead of barging into their office at random times of day. Similarly, TCP/IP describes how the various devices connected to each other on the internet can communicate in an orderly fashion.
Learning to Love the Command Line
While 99% of computer interfaces these days are graphical, there will always be a need for text-based command line tools. For the most part, these TCP/IP utilities work through the command line. That means you need to type in the name of the utility and the action you want it to take.
In Windows this has always been achieved through the Command Prompt, but that’s being phased out. The preferred command line interface today is Windows PowerShell.
To access the Powershell:
- Right-click on the Start Button
- Select Windows PowerShell (Admin)
Now you can type your commands into the command line in PowerShell to your heart’s content. If you want to walk the path of the PowerShell master, it begins with a single step. That is, Using PowerShell for Home Users – A Beginner’s Guide by our very own Guy McDowell.
Now let’s begin to know them better.
What is Netstat?
Netstat or Network Statistics is a powerful information utility that gives you important insights into what your network connection is doing at any given moment. It gives you basic statistics on key network activity. This includes which ports are open and in use and what connections are open and running.
Netstat isn’t just a Windows application, it’s on Linux, Unix and Mac as well. It started life on Unix and has become a fundamental weapon in the network administrator’s toolbox.
There is a graphical alternative in the form of Microsoft TCPView, but knowing how to use netstat will always be useful. There are many use cases for the program, but one common purpose these days is the detection of malware. Malicious software such as trojans often open a port and wait to be contacted by their creators for further instructions. With netstat you can quickly see if there’s a suspicious connection from your computer to the network.
Important Netstat Commands
Netstat is one of the easiest TCP/IP utilities to use. All you have to do is type “netstat” (without the quotes) and you’ll get the standard list of active connections. Which should look something like this:
This is fine for a normal overview of your network connections, but you can modify the output by using modifiers. For example, “netstat -a” displays all active ports and “netstat -b” will show you the executable file responsible for each listening port. Here are more key commands:
- Netstat -e – displays details of packets that have been sent
- Netstat -n – lists currently connected hosts
- Netstat -p – allow to specify what type of protocol you want to check
- Netstat -r – provides a list of routing tables
- Netstat -s – gives statistics on IPv4, IPv6, ICMP, TCP, etc
What is Tracert?
Tracert is short for traceroute. It’s a network utility that shows you information about every stop along the way from your computer’s network interface to the destination device.
When you use Tracert, the application sends special Internet Control Message Protocol (ICMP) packets which compel the devices at each hop to send back information. Specifically, it asks them to relay the exact time the packet arrived and then uses that information to calculate the travel time between each hop.
There are three main uses for Tracert:
- To see where a packet gets lost.
- To determine where packets are delayed.
- To see the IP addresses of each hop along the packet’s route.
Next, let’s see the Tracert command in action.
Important Tracert Commands
The most basic form of the Tracert command requires the name of the utility as well as the network destination. The destination can be expressed as either an IP address or a website URL. For example: Tracert www.google.com.
The output of the command looks like this:
Tracert also has a small number of options, here’s the list:
- Tracert -d: Tells Tracert not to resolve addresses to host names
- Tracert -h: Maximum_hops – lets you change the default number of hops, e.g. -h 30
- Tracert -j host-list: Specifies the LSR (loose source route) along the host list
- -w timeout: Lets you set how long Tracert waits at each hop before considering it a timeout. E.g. Tracert -w 1000
It’s a simple tool, but can be incredibly useful if you’re playing network detective!
What is IPconfig?
One of the most useful network TCP/IP utilities, IPconfig shows you the current configuration of network devices in your computer. It can also be used to manually force certain actions relating to your network connections.
IPconfig is particularly useful if your computer has an IP address assigned to it dynamically. Since it lets you quickly see what IP address your system currently has.
Important IPconfig Commands
IPconfig is generally used with a parameter, which either displays network information or performs a network-related task. Here are some of the most important commands to know:
- IPconfig /all: Shows you all physical and virtual network adapter connection information.
- IPconfig /flushdns: Resets the DNS resolver cache. Good for solving DNS-related problems.
- /IPconfig /renew: Forces a new IP address to be assigned.
IPconfig is the go-to utility for general internet connection troubleshooting, so it’s worth memorizing its key commands.
What is NSLookup?
NSlookup is short for nameserver lookup. A “nameserver” is a key type of server in the DNS (domain name system). It is in effect a DNS server and that means it’s a network device that connects the URL you type into your browser with the IP address of the server that hosts the content.
Usually this process is hidden from you as the user, but NSlookup lets you do two things:
- Find which IP address is behind a particular website address.
- To find the URL connected to a specific IP address.
So if you only have either a web address or an IP address, you can use NSlookup to find the other part of the puzzle. You can combine this with the information from other tools, such as Tracert or Netstat to determine which web servers are attached to the IP addresses they report.
Important NSLookup Commands
There are three main NSLookup commands you should know. The first is just “nslookup”. This shows you the current name server and its IP address.
Note that NSlookup is still running and you are at its command line, not PowerShell. If you want to go back to PowerShell, type exit and press enter.
However, let’s stick around for a second and ask our nameserver to give us the address for Google.com. Just type google.com and press enter.
As you can see, this gives us the IP address 172.217.170.46. Type that into your web browser and you’ll be taken straight to the Google search engine. You can also do a reverse search and enter an IP address, which should then return the URL of the server associated with it.
Now you’re familiar with four of the fundamental TCP/IP utilities that will help you understand what’s going on in your network and pull back the curtain on the mystery that is the internet. Have fun!
Sydney Butler is a social scientist and technology fanatic who tries to understand how people and technology coexist. He has two decades of experience as a freelance computer technician and more than a decade as a technologies researcher and instructor. Sydney has been a professional technology writer for more than five years and covers topics such as VR, Gaming, Cyber security and Transhumanism. Read Sydney’s Full Bio
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.