Network Commands in CMD: A Practical Guide
This article covers essential CMD network commands for diagnosing, troubleshooting, and managing network connectivity, with examples and practical use cases.
خلاصه تخصصی مقاله
This article covers essential CMD network commands for diagnosing, troubleshooting, and managing network connectivity, with examples and practical use cases.
موضوعات اصلی: پشتیبانی شبکه، شبکه، جدول، مسیر، ARP، MAC
Network commands in CMD
Command Prompt (CMD) provides a practical set of commands for diagnosing, troubleshooting, and managing network connectivity on Windows. Below we summarize key CMD network commands and explain what each does and when to use it.
Commonly used commands
- Hostname — show the host computer name.
- Ping — verify connectivity to an IP address or domain using ICMP packets.
- PathPing — assess the route and performance of intermediate routers.
- NETSTAT — display active connections and protocol statistics.
- Ipconfig — display IP configuration and interface status.
- NSLookup — query DNS for a domain.
- Tracert — show the path packets take to a destination.
- Tasklist — list running processes related to networking.
- Taskkill — terminate a specific process.
- arp — view and manage the ARP cache (IP-to-MAC mappings).
- net view — view computers on the local network or Workgroup.
- getmac — display MAC addresses of your network adapters.
- route print — display the system routing table.
Practical notes on ARP and other commands
ARP is useful for viewing and managing IP-to-MAC address mappings. For example, running arp -a shows entries in the ARP cache.
Table of 20 important network commands in CMD
| No. | Command | Main use | Usage example | Suitable for |
|---|---|---|---|---|
| 1 | ping | Test connectivity to a destination | ping 8.8.8.8 | Check internet connectivity |
| 2 | ping -t | Continuous connectivity test | ping -t google.com | Live monitoring |
| 3 | ipconfig | Show current IP configuration | ipconfig | View system IP |
| 4 | ipconfig /all | Show full network details | ipconfig /all | Verify DHCP and DNS |
| 5 | ipconfig /release | Release IP address | ipconfig /release | Resolve IP conflicts |
| 6 | ipconfig /renew | Renew IP address | ipconfig /renew | Obtain new DHCP lease |
| 7 | ipconfig /flushdns | Clear DNS cache | ipconfig /flushdns | DNS resolution issues |
| 8 | tracert | Show path to destination | tracert google.com | Diagnose path latency |
| 9 | pathping | Path analysis with packet loss | pathping 8.8.8.8 | Advanced troubleshooting |
| 10 | nslookup | DNS lookup for a domain | nslookup google.com | DNS resolution problems |
| 11 | netstat | Show active connections | netstat | Monitor open ports |
| 12 | netstat -ano | Show PID and ports | netstat -ano | Process-network mapping |
| 13 | arp -a | Show ARP table | arp -a | View ARP mappings |
| 14 | getmac | Show MAC addresses | getmac | Identify network hardware MAC |
| 15 | hostname | Show system name | hostname | Identify host name |
| 16 | route print | Show routing table | route print | Check Default Gateway |
| 17 | net view | Show network computers | net view | Workgroup discovery |
| 18 | net use | Manage network drives | net use | Connect to a network share |
| 19 | tasklist | Show running tasks | tasklist | Review network-related processes |
| 20 | taskkill | Terminate a specific process | taskkill /f /IM chrome.exe | Stop problematic program |
برای ارزیابی پایداری، امنیت و نگهداری این زیرساخت، راهنمای پشتیبانی شبکه را نیز مطالعه کنید.