Network Troubleshooting: 10 Essential Commands Everyone Should Know
Master essential network commands like ping, traceroute, nslookup, and more. Complete guide with real-world troubleshooting examples.
Master these 10 essential network commands to diagnose connection issues, test connectivity, and troubleshoot network problems like a pro. This comprehensive guide covers commands for Windows, Mac, and Linux.
1. Ping - Test Network Connectivity
What it does: Tests if a host is reachable and measures round-trip time.
Command: ping example.com
Use cases:
- Check if a website/server is online
- Measure network latency
- Detect packet loss
Try our graphical Ping Tool for easier testing!
2. Traceroute/Tracert - Trace Network Path
What it does: Shows the path packets take to reach a destination.
Command:
- Windows:
tracert example.com - Mac/Linux:
traceroute example.com
Use cases:
- Identify where connection fails
- Find network bottlenecks
- Diagnose routing issues
3. Nslookup - DNS Lookup
What it does: Queries DNS servers to find IP addresses for domain names.
Command: nslookup example.com
Use cases:
- Verify DNS resolution
- Check which DNS server is being used
- Troubleshoot DNS issues
4. Ipconfig/Ifconfig - Network Configuration
What it does: Displays network adapter configuration.
Command:
- Windows:
ipconfig /all - Mac/Linux:
ifconfigorip addr show
Use cases:
- Find your IP address
- Check DNS servers in use
- View network adapter details
5. Netstat - Network Statistics
What it does: Shows active network connections and listening ports.
Command: netstat -an
Use cases:
- See all active connections
- Check which ports are open
- Identify suspicious connections
6. Curl - Test HTTP/HTTPS Requests
What it does: Makes HTTP requests from command line.
Command: curl -I https://example.com
Use cases:
- Test website response
- Check HTTP headers
- Debug API issues
7. Dig - Advanced DNS Lookup
What it does: Detailed DNS query tool (Mac/Linux).
Command: dig example.com
Use cases:
- Get detailed DNS information
- Query specific record types
- Troubleshoot DNS propagation
8. Route - View Routing Table
What it does: Displays and modifies network routing table.
Command:
- Windows:
route print - Mac/Linux:
route -n
9. Arp - View ARP Cache
What it does: Shows IP-to-MAC address mappings.
Command: arp -a
Use cases:
- See devices on local network
- Troubleshoot local network issues
10. Pathping - Combined Ping and Traceroute
What it does: Combines ping and traceroute with statistics (Windows).
Command: pathping example.com
Use cases:
- Detailed route analysis
- Find packet loss at each hop
Common Troubleshooting Workflows
Website Won't Load
- Run
ping example.com- Check if site is reachable - Run
nslookup example.com- Verify DNS works - Try
ping 8.8.8.8- Test if internet works at all - Flush DNS cache
Slow Internet Connection
- Run speed test - Measure current speeds
- Run
ping -t gateway_ip- Check local network latency - Run
traceroute example.com- Find where delay occurs - Check
netstat -an- See if something is using bandwidth
Can't Connect to Specific Website
- Ping the domain - Is it responding?
- Nslookup the domain - Is DNS working?
- Try different DNS server (1.1.1.1)
- Flush DNS cache and browser cache
Quick Reference Table
| Command | Purpose | When to Use |
|---|---|---|
| ping | Test connectivity | Website not loading |
| traceroute | Find network path | Find where connection fails |
| nslookup | DNS lookup | DNS problems |
| ipconfig | Network info | Check IP/DNS settings |
Prefer GUI Tools? Use our web-based Ping, DNS Lookup, and Speed Test tools - no command line needed!