
Toolkit: Diagnostic Commands Quick Reference
Toolkit 5 of 10 · Diagnostic Commands Quick Reference · Adapted from Appendix C and §7.1–7.4 of Dr. Tahseen Al Doori's Troubleshooting Essentials, University Edition (2026). Notes marked Beyond the book are additions by the course, checked against the official sources listed.
How to use this sheet
Find the task you need in the left-hand column, then read across to the command for Windows, macOS or Linux. The second table tells you what to look for in the output. Run commands on a training machine or virtual machine while you are learning. Some commands need administrator rights; repair commands change the system and are marked with a warning.
Repair commands change your system. chkdsk /f, fsck, sfc /scannow and Disk Utility First Aid repair file systems or system files. Never run a disk repair on a drive that may be failing or that holds the only copy of important data: back up first, and if a drive may be failing, stop and escalate. Practise on a training machine or virtual machine.
Part 1 — Command reference
Adapted from Appendix C of the book.
| Task | Windows | macOS | Linux |
|---|---|---|---|
| Show IP configuration | ipconfig /all | ifconfig | ip addr |
| Renew IP address | ipconfig /release then ipconfig /renew | System Settings > Network > Renew DHCP | sudo dhclient -r; sudo dhclient |
| Flush DNS cache | ipconfig /flushdns | sudo dscacheutil -flushcache | resolvectl flush-caches |
| Test reachability | ping host | ping host | ping host |
| Trace route | tracert host | traceroute host | traceroute host |
| DNS lookup | nslookup name | nslookup name | nslookup name / dig name |
| Connections and ports | netstat -an | netstat -an | ss -tuln |
| Running processes | tasklist / Task Manager | Activity Monitor / top | top / ps aux |
| System logs | Event Viewer | Console | journalctl |
| Check disk | chkdsk /f | Disk Utility > First Aid | fsck (unmounted) |
| Repair system files | sfc /scannow | — | Package manager reinstall |
Part 2 — What to look for
Based on §7.3 of the book.
| Command | Purpose | What to look for |
|---|---|---|
ipconfig /all, ip addr, ifconfig | Show IP configuration | A valid IP address, subnet mask, default gateway and DNS servers. An address beginning 169.254 means no DHCP response |
ping | Test reachability | Replies with low, stable times. "Request timed out" means no response |
tracert / traceroute | Show the path to a host | The hop where replies stop or delays jump |
nslookup | Test name resolution (DNS) | The correct IP address returned for a name |
netstat -an | Show connections and listening ports | Expected services listening; unexpected connections |
ipconfig /release, /renew, /flushdns | Refresh addressing and the DNS cache | A new valid address; stale names cleared |
Part 3 — The five-step connectivity test
From §7.3 of the book. Run in order; the first command that fails shows where the fault lies.
ping 127.0.0.1 # 1. Is the TCP/IP stack working locally?
ipconfig # 2. Do I have a valid IP address and gateway?
ping <default gateway> # 3. Can I reach my router?
ping 8.8.8.8 # 4. Can I reach the internet by IP address?
ping google.com # 5. Does name resolution (DNS) work?
Part 4 — Monitoring and recovery tools
From §7.1, §7.2 and §7.4 of the book.
| Tool | Platform | Use |
|---|---|---|
| Task Manager (Ctrl+Shift+Esc) | Windows | Applications, CPU, memory, disk and network use; startup programs |
| Resource Monitor | Windows | Detailed per-process use of CPU, memory, disk and network |
| Activity Monitor | macOS | Processes, CPU, memory, energy, disk and network use |
top / htop | Linux, macOS | Live list of processes and resource use in the terminal |
| Device Manager | Windows | Hardware devices and driver status; warning icons for faulty devices |
| Event Viewer | Windows | Windows Logs: Application, System and Security |
| Console | macOS | System logs |
journalctl, /var/log | Linux | System logs |
| Safe mode | All | Start with minimal drivers and software, for isolation |
| System Restore / Time Machine | Windows / macOS | Return the system to an earlier working state |
| Automated troubleshooters / Wireless Diagnostics | Windows / macOS | Check common settings automatically |
Part 5 — Notes for current systems
Beyond the book (2026 note): netstat on Linux is legacy. The Linux manual page for netstat describes the program as "mostly obsolete" and names ss as its replacement (and ip route in place of netstat -r). This is why the book's table uses ss -tuln for Linux: -t shows TCP sockets, -u UDP sockets, -l only listening sockets and -n numeric ports instead of service names. On Windows and macOS, netstat -an remains the command shown in the book.
Beyond the book (2026 note): ip rather than ifconfig on Linux. The book already gives ip addr for Linux. ip address (which can be shortened to ip addr) shows the IPv4 and IPv6 addresses on every interface. The Linux ifconfig manual page itself points to ip link from the iproute2 package for full link-layer details such as hardware addresses. For macOS, the book gives ifconfig.
Beyond the book (2026 note): Linux DNS cache and DHCP renewal depend on the system's network services. resolvectl flush-caches clears the caches kept by the systemd-resolved service, so it applies only where that service is in use. Likewise, dhclient works only where that DHCP client is installed and managing the interface; if your distribution manages networking with a different service, renew the address with that service's own tool, as described in your distribution's documentation.
Beyond the book (2026 note): renewing a DHCP lease on current macOS. In current versions of macOS the path is: Apple menu > System Settings > Network > choose the network service > Details > TCP/IP > Renew DHCP Lease. The button is available only when the service is set to use DHCP.
Beyond the book (2026 note): chkdsk /f locks the drive. Microsoft's reference states that /f fixes errors only if the disk can be locked; if files are open, chkdsk offers to check the drive at the next restart, and you cannot open files on the drive until it finishes. Run without parameters, chkdsk reports the volume's status without fixing anything, which is the safer first look. Administrator rights are required.
Beyond the book (2026 note): run DISM before sfc /scannow. Microsoft's guidance for current versions of Windows is to run DISM.exe /Online /Cleanup-image /Restorehealth in an elevated Command Prompt before running sfc /scannow. Both commands need administrator rights and should be run only where policy allows.
Beyond the book (2026 note): a PowerShell alternative on Windows. ipconfig, ping, tracert and nslookup are all current on Windows. PowerShell also offers Test-NetConnection, which can run a ping test (Test-NetConnection <host>), a route trace (-TraceRoute) or a TCP port test (-Port <number>), useful when one application cannot connect on its port.
Sources
- Dr. Tahseen Al Doori — Troubleshooting Essentials, University Edition (2026), Appendix C, §7.1–7.4
- netstat(8) — Linux manual page (man7.org)
- ss(8) — Linux manual page (man7.org)
- ip-address(8) — Linux manual page (man7.org)
- ifconfig(8) — Linux manual page (man7.org)
- resolvectl(1) — Linux manual page (man7.org)
- Change TCP/IP settings on Mac — Apple Support
- ipconfig — Microsoft Learn
- chkdsk — Microsoft Learn
- Use the System File Checker tool to repair missing or corrupted system files — Microsoft Support
- Test-NetConnection — Microsoft Learn
