Command Prompt - Four networking commands you should know
In one of our previous tutorials, you learned how to use basic commands in Command Prompt . Now it's time to take things to the next level and see how to use some of the more advanced commands. Today, we're going to take a close look at some very useful network commands. We will learn about things like how to view information about network devices and connections or how to check the availability of a network host or internet website. For all this, and more, read this tutorial:
NOTE: The information shared in this tutorial applies to Windows 10, Windows 8.1 and Windows 7. For simplicity, we will use screenshots taken in Windows 10.
1. Retrieving information about your network connections
To obtain detailed information about your network connection, 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 a list with all the network devices found on your system and their IP addresses. You also get details like the default gateway, subnet mask or the state of the 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'll get from the "ipconfig /all" command .
It's worth mentioning that the ipconfig command also allows you to perform some other operations, if you use the right parameter. For example, the "ipconfig /release" and "ipconfig /renew" commands force your network adapter to drop and renew the current IP address.
The release and renew parameters are useful in networks that use DHCP (Dynamic Host Configuration Protocol) to distribute IP addresses automatically. Basically, 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.
2. Finding your network adapter's MAC addresses
Another way to obtain the MAC addresses of your network adapters is to use the getmac command. In Command Prompt , type getmac and press Enter , like in the image below.
3. Testing the connection to a website or to a network location
To test your connection to a certain website or another network or internet location, you can use the ping network command, followed by a web address or IP address. For instance, if you want to check the connectivity to Digital Citizen , without opening a web browser, type the command "ping www.digitalcitizen.life" and then press the Enter key on your keyboard .
The ping command also allows you to use the very useful "-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 "CRTL + 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.
4. Check your computer's network connections and open ports
T he netstat command 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, like in the image below.
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 also very useful when you have networking issues and you're trying to troubleshoot them by yourself. If you have any questions about the networking commands, or if you need help with any of them, don't hesitate to leave us a comment below.