Network Diagnostics
Network diagnostic commands help you verify connectivity, resolve DNS names, trace packet routes, and inspect active connections.Ping — Test Basic Connectivity
Ping sends ICMP echo requests to a target host and measures the round-trip time. It confirms whether a host is reachable and whether there is packet loss.-n <count>(Windows) /-c <count>(macOS/Linux): Send a specific number of packets-t(Windows): Ping continuously until stopped withCtrl+C-i <interval>(Linux/macOS): Set interval between packets in seconds
Request timed out indicates the host is unreachable or blocking ICMP. High latency or intermittent packet loss suggests a network path issue.
Tracert / Traceroute — Trace Packet Route
Tracert (Windows) and traceroute (macOS/Linux) show each hop a packet takes to reach its destination, helping you identify where in the network path a failure or delay is occurring.-d(Windows) /-n(Linux): Do not resolve IP addresses to hostnames (faster)-h <max_hops>(Windows): Set maximum hop count (default 30)
* * *) at a specific hop indicate packet loss at that hop. High latency at one hop that does not improve in subsequent hops often points to a congested or mis-configured router at that point.
IPConfig / IFConfig — IP Address and Network Adapter Information
- Check the assigned IP address, subnet mask, and default gateway
- Look for
169.254.x.x(APIPA) addresses, which indicate DHCP has failed - Use
ipconfig /flushdnsto clear the local DNS cache when resolving stale DNS records
NSLookup — DNS Query Tool
NSLookup queries DNS servers to resolve names to IP addresses or look up specific DNS record types.8.8.8.8) to determine if a DNS resolution issue is local or global. Use dig +trace to follow the full delegation chain from root servers.
Netstat — Active Connections and Listening Ports
Netstat displays active TCP/UDP connections, listening ports, and associated process IDs.-a: Show all connections and listening ports-n: Show addresses as numbers (no DNS lookup)-o(Windows): Show owning process ID-b(Windows): Show the executable involved in each connection-p(Linux): Show the process using the socket
Test-NetConnection / Curl — Port-Level Connectivity
TcpTestSucceeded: True (Windows) or succeeded (nc) confirms the port is open and the service is listening. Failures indicate a firewall block, service not running, or wrong port.
Disk & Storage
CHKDSK — Check Disk for Errors
CHKDSK scans the file system and disk surface for errors and optionally repairs them./f: Fix errors on the disk/r: Locate bad sectors and recover readable information (includes/f)/x: Force the volume to dismount first
SMART Status — Drive Health
Self-Monitoring, Analysis and Reporting Technology (SMART) data gives early warning of drive failures.SMART overall-health self-assessment test result: PASSED— drive is healthyFAILED!— replace the drive immediately and recover data- Attributes with high
RAW_VALUEon:Reallocated_Sector_Ct,Pending_Sector_Count,Uncorrectable_Sector_Count
DF / DU — Disk Free Space and Usage
df -h: Show disk free space in human-readable formatdu -sh <path>: Show total size of a directory--max-depth=1/-d 1: Limit depth to one level
System Information
Windows-Specific Commands
SFC — System File Checker
Scans protected Windows system files for corruption and replaces damaged files.%windir%\Logs\CBS\CBS.log. Look for lines containing [SR] for System File Checker activity. If SFC reports it cannot fix certain files, run DISM first.
DISM — Deployment Image Servicing and Management
DISM repairs the Windows Component Store, which SFC depends on. Run DISM before SFC when SFC fails to repair files.Windows Event Log Queries
GPResult — Group Policy Results
/h to generate an HTML report, which is the most readable format for reviewing applied policies. Open the resulting file in a browser.
Msinfo32 — System Information GUI
msinfo32 provides a comprehensive snapshot of hardware, software, and system configuration, including installed drivers, running services, and IRQ/port assignments.