Here are some of the most important networking commands in Windows that you can use in the Command
Prompt (CMD):
1. ipconfig: Displays the IP address, subnet mask, and default gateway for all network adapters. Use ipconfig /all
to see detailed information, including MAC address, DNS servers, and more.
2. ping: Checks the connectivity between your computer and a specific IP address or hostname. It sends packets
and measures the time it takes to receive a reply.
- Example: ping google.com
3. tracert: Traces the route packets take from your computer to a specific IP address or hostname, showing each
hop along the way.
- Example: tracert google.com
4. netstat: Displays active TCP connections, ports on which the computer is listening, Ethernet statistics, and
more.
- Example: netstat -an (Shows all active connections and listening ports)
5. nslookup: Queries the DNS to obtain domain name or IP address mapping. Useful for troubleshooting DNS
issues.
- Example: nslookup google.com
6. arp: Displays or modifies the ARP (Address Resolution Protocol) cache, which contains mappings of IP
addresses to MAC addresses.
- Example: arp -a (Displays the ARP cache)
7. route: Displays or modifies the routing table used by the computer to determine the best route to a
destination.
- Example: route print (Shows the routing table)
8. netsh: A versatile command for configuring network settings, including the firewall, IP address, and more.
- Example: netsh interface ip set address "Local Area Connection" static 192.168.1.10 255.255.255.0
192.168.1.1 (Sets a static IP address)
9. getmac: Displays the MAC address of your network adapters.
- Example: getmac /v (Displays detailed information)
10. hostname: Displays the name of the current host (computer).
- Example: hostname
These commands are essential for diagnosing and managing network settings and connections in a Windows
environment.