Best 21+ CMD Network Commands for IT Professionals in 2025
By Mukesh Kumar
Updated on Mar 04, 2025 | 26 min read | 1.5k views
Share:
For working professionals
For fresh graduates
More
By Mukesh Kumar
Updated on Mar 04, 2025 | 26 min read | 1.5k views
Share:
CMD network commands are built into Windows for managing and troubleshooting networks, but many, like ping and netstat, are also available on Linux and macOS. IT professionals often troubleshoot network issues and configure connections. Knowing the right networking commands can make a big difference in solving these problems quickly.
In this guide, you’ll learn 21+ essential CMD network commands that will help you streamline network management and improve efficiency in your daily tasks.
At the core, networking commands are short text instructions that you input into the Command Prompt (CMD) to manage network activities. These commands enable you to interact directly with your network hardware, such as routers, switches, and wireless adapters, without the need for a graphical user interface.
Using CMD for network tasks helps diagnose and configure networks by enabling actions like checking connectivity (ping), tracing routes (tracert), and managing IP configurations (ipconfig).
While modern graphical tools are useful, CMD provides more control and flexibility, allowing you to access network settings quickly and precisely.
How Networking Commands Help Improve Network Performance and Connectivity?
CMD network commands like ping and tracert help diagnose and troubleshoot connectivity issues, but they don't directly optimize wireless network performance.
By learning these commands, you can improve your network’s speed, diagnose potential issues, and make sure your connection stays stable.
Some key benefits of using CMD networking commands include:
Now that you understand the basics, let's dive into the key CMD commands that put you in control of your wireless network management.
The ping command is a fundamental tool used to test the reachability of a host on an IP network.
Purpose: To verify network connectivity between your computer and another device.
Key Features:
Syntax:
ping [destination IP address or hostname]
Functions:
Use Cases and Examples:
ping 192.168.1.1
ping www.example.com
Benefits and Challenges:
The tracert (or traceroute on Unix-based systems) command traces the path that your data takes to reach a destination.
Purpose: To identify the route and measure transit delays of packets across an IP network.
Key Features:
Syntax:
tracert [destination IP address or hostname]
Functions:
Use Cases and Examples:
tracert www.example.com
tracert 192.168.1.1
Benefits and Challenges:
The ipconfig (or ifconfig on Unix-based systems) command displays the current network configuration of your computer.
Purpose: To view and manage network interface settings.
Key Features:
Syntax:
ipconfig
Functions:
Use Cases and Examples:
ipconfig
ipconfig /release
ipconfig /renew
Benefits and Challenges:
The netstat command provides information about network connections, routing tables, and interface statistics.
Purpose: To display active network connections and listening ports.
Key Features:
Syntax:
netstat
Functions:
Use Cases and Examples:
To see all active TCP connections:
netstat -a
To view ports that are currently being listened to by the system:
netstat -an | find "LISTEN"
To display information about network interfaces:
netstat -i
Benefits and Challenges:
The nslookup command is used to query Domain Name System (DNS) servers to obtain domain name or IP address mapping.
Purpose: To troubleshoot DNS-related issues and retrieve information about domain names or IP addresses.
Key Features:
Syntax:
nslookup [domain name or IP address]
Functions:
Use Cases and Examples:
To find the IP address for a domain:
nslookup www.example.com
To use a specific DNS server for the query:
nslookup www.example.com 8.8.8.8
Benefits and Challenges:
nslookup is an invaluable tool for network administrators when dealing with DNS errors or testing DNS configurations.
The netsh command allows you to view and modify the network configuration of a Windows computer.
Purpose: To configure network settings, troubleshoot issues, and manage network connections.
Key Features:
Syntax:
netsh [context] [command]
Functions:
Use Cases and Examples:
To reset the TCP/IP stack, often used for troubleshooting:
netsh int ip reset
To see network settings of a specific network interface:
netsh interface ipv4 show config
To configure a wireless network:
netsh wlan set hostednetwork mode=allow ssid=YourNetwork key=YourPassword
Benefits and Challenges:
With netsh, you have comprehensive control over network configuration and troubleshooting on Windows, making it a critical tool for network professionals.
The route command is used to display and manipulate the network routing table in Windows.
Purpose: To add, delete, and display network routes used by your computer to send traffic.
Key Features:
Syntax:
route [command] [parameters]
Functions:
Use Cases and Examples:
To view the current network routes:
route print
To add a static route for a specific destination:
route add 192.168.1.0 mask 255.255.255.0 192.168.0.1
To remove a specific route from the routing table:
route delete 192.168.1.0
Benefits and Challenges:
The arp command is used to display and manipulate the ARP (Address Resolution Protocol) cache in your computer’s memory.
Purpose: To manage and display the ARP cache, which maps IP addresses to MAC addresses.
Key Features:
Syntax:
arp [command] [parameters]
Functions:
Use Cases and Examples:
To display the ARP cache:
arp -a
To remove a specific ARP entry:
arp -d 192.168.1.1
To add a static ARP entry:
arp -s 192.168.1.100 00-aa-bb-cc-dd-ee
Benefits and Challenges:
The ip command is used for network configuration and management in Linux-based operating systems.
Purpose: To configure, display, and manage network interfaces, routes, and other network parameters.
Key Features:
Syntax:
ip [command] [parameters]
Functions:
Use Cases and Examples:
To display all network interfaces:
ip addr show
To add an IP address to a specific interface:
ip addr add 192.168.1.100/24 dev eth0
To remove an IP address from an interface:
ip addr del 192.168.1.100/24 dev eth0
Benefits and Challenges:
The ssh command is used to securely access and manage remote servers or network devices over a network.
Purpose: To provide secure, encrypted communication with remote devices.
Key Features:
Syntax:
ssh [user]@[hostname]
Functions:
Use Cases and Examples:
To log in to a remote server:
ssh user@192.168.1.1
To copy a file to the remote server using SCP:
scp localfile.txt user@192.168.1.1:/remote/path
To set up a secure tunnel for data traffic:
ssh -L 8080:localhost:80 user@192.168.1.1
Benefits and Challenges:
Also Read: Kubernetes Networking: A Complete Guide to Understand Network Model
The curl command is used to transfer data from or to a server, supporting various protocols like HTTP, FTP, and more.
Purpose: To interact with URLs for testing APIs, downloading files, or fetching web content.
Key Features:
Syntax:
curl [options] [URL]
Functions:
Use Cases and Examples:
To fetch the content of a webpage:
curl https://example.com
To send a POST request with data to an API:
curl -X POST -d "name=John&age=30" https://example.com/api
To download a file from a URL:
curl -O https://example.com/file.zip
Benefits and Challenges:
The dig (Domain Information Groper) command is used for querying DNS (Domain Name System) records.
Purpose: To fetch information about DNS records for a domain or IP address.
Key Features:
Functions:
Use Cases and Examples:
To get the A record (IP address) for a domain:
dig example.com A
To fetch the mail exchange (MX) record for a domain:
dig example.com MX
Reverse DNS Lookup:
To find the domain associated with an IP address:
dig -x 8.8.8.8
Benefits and Challenges:
The hostname command is used to display or set the system’s hostname in Linux/Unix-like operating systems.
Purpose: To view or change the system hostname.
Key Features:
Syntax:
hostname [options] [hostname]
Functions:
Use Cases and Examples:
To display the current hostname of your system:
hostname
To set a new hostname for your system:
sudo hostname newhostname
To display the fully qualified domain name of the system:
hostname -f
Benefits and Challenges:
The telnet command is used to connect to remote systems over the Telnet protocol, providing a command-line interface for interaction.
Purpose: To access remote devices and troubleshoot network issues via a command-line interface.
Key Features:
Syntax:
telnet [hostname] [port]
Functions:
Use Cases and Examples:
To connect to a remote server via Telnet:
telnet example.com 23
To test if a specific port is open on a remote server:
telnet example.com 80
Benefits and Challenges:
The iwconfig command is used to configure wireless network interfaces in Linux-based systems.
Purpose: To manage wireless network interfaces, set parameters, and view wireless network configurations.
Key Features:
Syntax:
iwconfig [interface] [parameters]
Functions:
Use Cases and Examples:
To view the wireless interface’s details:
iwconfig wlan0
To connect to a Wi-Fi network with WPA2 encryption:
iwconfig wlan0 essid "NetworkName" key s:password
To set the wireless mode to Managed (for connecting to access points):
iwconfig wlan0 mode managed
Benefits and Challenges:
The netcat command, often abbreviated as nc, is a versatile tool used for reading from and writing to network connections using TCP or UDP.
Purpose: To establish network connections, troubleshoot, and transfer data over networks.
Key Features:
Syntax:
nc [options] [hostname] [port]
Functions:
Use Cases and Examples:
To connect to a remote server on port 80:
nc example.com 80
To listen on port 1234 for incoming connections:
nc -l 1234
send a file over a network using netcat:
nc -w 3 example.com 1234 < file.txt
Benefits and Challenges:
Also Read: Top 20+ Networking Certifications for Your IT Career in 2025: A Complete Guide
The nmap (Network Mapper) command is a powerful tool used for network discovery and security auditing.
Purpose: To discover devices, services, and vulnerabilities on a network.
Key Features:
Syntax:
nmap [options] [target]
Functions:
Use Cases and Examples:
To scan a host for open ports:
nmap example.com
To scan multiple IP addresses for open ports:
nmap 192.168.1.1-100
To detect versions of services running on a host:
nmap -sV example.com
Benefits and Challenges:
The iperf command is used for measuring network bandwidth performance between two systems.
Purpose: To test the throughput between two systems over a network.
Key Features:
Syntax:
iperf [options]
Functions:
Use Cases and Examples:
To test the bandwidth between a client and server:
iperf -c server_ip
To start iperf in server mode:
iperf -s
To test UDP bandwidth instead of TCP:
iperf -c server_ip -u
Benefits and Challenges:
The tcpdump command is a packet analyzer used to capture and display network traffic in real-time.
Purpose:
To capture and analyze network traffic for troubleshooting and security analysis.
Key Features:
Syntax:
tcpdump [options] [expression]
Functions:
Use Cases and Examples:
To capture all traffic on the default network interface:
tcpdump
To capture traffic on port 80 (HTTP):
tcpdump port 80
To capture traffic from a specific IP address:
tcpdump host 192.168.1.1
Benefits and Challenges:
The scp (Secure Copy) command is used to copy files securely between hosts over a network using SSH.
Purpose:
To securely transfer files between systems using encryption.
Key Features:
Syntax:
scp [options] [source] [destination]
Functions:
Use Cases and Examples:
To copy a file to a remote server:
scp file.txt user@remote:/path/to/destination
To copy an entire directory (recursively):
scp -r /local/directory user@remote:/path/to/destination
To copy a file from a remote server to your local machine:
scp user@remote:/path/to/file.txt /local/destination
Benefits and Challenges:
The lsof command is used to list open files and the processes that opened them on a system.
Purpose:
To display information about files opened by processes in the system.
Key Features:
Syntax:
lsof [options]
Functions:
Use Cases and Examples:
To list all open files on the system:
lsof
To display files opened by a particular user:
lsof -u username
To view network connections and open ports:
lsof -i
Benefits and Challenges:
The mtr command is a network diagnostic tool that combines the functionality of ping and traceroute.
Purpose:
To trace network paths and diagnose network issues by combining real-time ping and traceroute results.
Key Features:
Syntax:
mtr [options] [hostname or IP]
Functions:
Use Cases and Examples:
To trace the network path to a destination:
mtr example.com
To limit the trace to 10 hops:
mtr --max-hops 10 example.com
To display a summary of the test without all hop details:
mtr --report example.com
Benefits and Challenges:
Also Read: Raspberry Pi Commands: General, Networking, Internet, File & System Information
Now that you've covered the essentials, let's dive into real-world scenarios where these commands truly shine.
In this section, you’ll find detailed examples of how to use each of the commands. These are practical scenarios, so you’ll not only understand the theory but also see how each command can be used in real-life situations.
The ping command is your first line of defense in diagnosing network connectivity issues. It helps you test whether your device can reach another device (like a server or router) on the network.
You can also use it to measure network latency (how long it takes for a packet of data to travel to a destination and back).
Example 1: Ping a website to check connectivity
ping www.google.com
Output:
Pinging www.google.com [142.250.190.78] with 32 bytes of data:
Reply from 142.250.190.78: bytes=32 time=15ms TTL=115
Reply from 142.250.190.78: bytes=32 time=16ms TTL=115
Reply from 142.250.190.78: bytes=32 time=16ms TTL=115
Reply from 142.250.190.78: bytes=32 time=15ms TTL=115
Ping statistics for 142.250.190.78:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 15ms, Maximum = 16ms, Average = 15ms
Explanation:
Pinging www.google.com may not always work, as some websites block ICMP requests. A better example is pinging a reliable public DNS server like 8.8.8.8 (Google DNS) or an internal network device.
The tracert (trace route) command helps you track the path that a packet takes from your computer to a destination host. It’s invaluable for identifying where network delays are occurring.
Example 1: Trace the route to a website
tracert www.google.com
Output:
Tracing route to www.google.com [142.250.190.78] over a maximum of 30 hops:
1 <1 ms <1 ms <1 ms 192.168.1.1
2 5 ms 6 ms 5 ms 10.0.0.1
3 10 ms 11 ms 10 ms 172.217.5.1
4 14 ms 13 ms 15 ms 108.177.10.34
5 20 ms 19 ms 19 ms 142.250.190.78
Trace complete.
Explanation:
The ipconfig command is used to display your computer’s IP configuration. It’s especially helpful for checking your IP address, subnet mask, and default gateway.
Example 1: View your network configuration
ipconfig
Output:
Windows IP Configuration
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . : local
IPv4 Address. . . . . . . . . . . : 192.168.1.100
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1
Explanation:
Example 2: Release and renew your IP address
ipconfig /release
ipconfig /renew
Explanation:
The netstat command is used to display active network connections, routing tables, and network statistics. It’s helpful for understanding what services are using network ports.
Example 1: View all active network connections
netstat -an
Output:
Proto Local Address Foreign Address State
TCP 192.168.1.100:80 0.0.0.0:0 LISTENING
TCP 192.168.1.100:443 0.0.0.0:0 LISTENING
TCP 192.168.1.100:5100 192.168.1.200:443 ESTABLISHED
Explanation:
The arp command is used to manage the Address Resolution Protocol (ARP) cache, which maps IP addresses to MAC addresses on a local network.
Example 1: View the ARP cache
arp -a
Output:
Interface: 192.168.1.100 --- 0x4
Internet Address Physical Address Type
192.168.1.1 00-14-22-01-23-45 dynamic
192.168.1.200 00-14-22-11-23-56 dynamic
Explanation:
Example 2: Delete an ARP cache entry
arp -d 192.168.1.200
Explanation:
By now, you’ve learned how to use several of the most important CMD network commands effectively. Each command has its own purpose and is a useful tool when diagnosing or troubleshooting network issues.
Also Read: 55+ Top Networking Interview Questions and Answers for All Skill Levels in 2025
Don’t hesitate to experiment with these examples to understand better how they work in real time. The more you practice, the more confident you’ll become in using networking commands to solve problems on your network.
With a global community of over 10 million learners and access to more than 200 specialized courses, upGrad offers the perfect platform to boost your networking skills.
Whether you're a beginner looking to master the basics or an intermediate learner aiming to refine your expertise, upGrad's comprehensive courses in networking and IT infrastructure ensure you stay ahead of the curve.
Here are some of the top courses to choose from:
You can also get personalized career counseling with upGrad to guide your career path, or visit your nearest upGrad center and start hands-on training today!
Boost your career with our popular Software Engineering courses, offering hands-on training and expert guidance to turn you into a skilled software developer.
Master in-demand Software Development skills like coding, system design, DevOps, and agile methodologies to excel in today’s competitive tech industry.
Stay informed with our widely-read Software Development articles, covering everything from coding techniques to the latest advancements in software engineering.
Get Free Consultation
By submitting, I accept the T&C and
Privacy Policy
India’s #1 Tech University
Executive PG Certification in AI-Powered Full Stack Development
77%
seats filled
Top Resources