OS-independent troubleshooting is a way of finding a fault that works the same on any operating system (OS), whether Windows, Linux or macOS: the steps stay fixed and only the commands change. Most problems that look like "the computer is broken" are one layer failing underneath everything above it, and the job is to find which layer before changing anything. To run the checks on your own machine, skip to Check yours on Linux and Windows.
The steps
- Get the exact symptom. The full error text, when it started, and what changed just before.
- Reproduce it. A fault you can trigger on demand is a fault you can test a fix against.
- Test from the bottom up. Power and hardware, then the connection, the address, the route, name resolution, the service, and the application last.
- Change one thing at a time. Test after each change, and undo it if it didn't help.
- Read the logs. The system usually wrote down what went wrong before anyone asked.
- Write down the cause and the fix. The second time it happens, that note is the fix.
Steps 3 and 4 do most of the work. Testing bottom up means each check rules out everything under it, so a passing test is as useful as a failing one. Changing several things at once means that when the problem goes away, nobody knows which change fixed it, or what the other changes broke.
Why bottom up
Every layer depends on the ones below it, the same stack covered in the Open Systems Interconnection (OSI) and TCP/IP models. A browser can't load a page if the name doesn't resolve, the name can't resolve if the resolver isn't reachable, and nothing is reachable without an address and a route.
So when a page won't load, check the browser last.
Check yours on Linux and Windows
The worked example is a website that won't load, checked bottom up, one command per layer. On Linux every step below passed, which is the point of showing it: this is what "working" looks like at each layer, to compare against when something isn't.
On Linux
Does the interface have an address?
ifconfigwlp0s20f3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.100.40 netmask 255.255.255.0 broadcast 192.168.100.255Only the first two lines of the Wi-Fi interface are shown.
UP in the flags and an inet line with a private address mean this layer works.
An interface without UP, or with no inet line, or with an address starting 169.254, stops the search here: that last one is an address a machine gives itself when no server handed it one.
Is there a route out, and through which gateway?
route -nKernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.100.1 0.0.0.0 UG 600 0 0 wlp0s20f3
192.168.100.0 0.0.0.0 255.255.255.0 U 600 0 0 wlp0s20f3-n prints numbers instead of names.
The 0.0.0.0 line is the default route: traffic for the internet leaves through 192.168.100.1, the router.
Does the gateway answer?
ping -c 3 192.168.100.1 | tail -23 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 2.098/4.566/7.431/2.195 ms-c 3 sends three packets and stops, and tail -2 keeps only the two summary lines.
The local network works. If this fails, the problem is between the laptop and the router: the Wi-Fi link, the cable, or the router itself.
Does an internet address answer, with no names involved?
ping -c 3 1.1.1.1 | tail -23 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 25.596/49.024/94.240/31.979 msPinging an IP address skips the Domain Name System (DNS) entirely, so this tests the route to the internet on its own. Some networks block ping, so a failure here is a hint rather than proof.
Do names resolve?
nslookup example.comServer: 127.0.0.53
Address: 127.0.0.53#53
Non-authoritative answer:
Name: example.com
Address: 172.66.147.243
Name: example.com
Address: 104.20.23.154The IPv6 answers are cut.
Server is the resolver that answered, here the one running on the laptop itself, and each Address line is an answer.
If step 4 passed and this fails, the internet is fine and DNS is broken: that's the classic "the internet is down, but only for websites."
Does the service answer?
curl -sI https://example.com | head -1HTTP/2 200-I asks only for the response headers, -s hides the progress meter, and head -1 keeps the status line.
A 200 means the web server answered and the page exists.
If everything up to here passes and the browser still fails, the problem is in the browser: an extension, a proxy setting, or its cache.
On Windows
These run in Command Prompt. Nothing here was captured on Windows, so no output is shown; the same six steps apply.
Address: ipconfig, then the "IPv4 Address" line of the adapter you use.
Route and gateway: the "Default Gateway" line of the same ipconfig output, or route print for the full table.
Gateway answers: ping followed by the gateway address. Windows sends four packets by default.
Internet answers: ping 1.1.1.1.
Names resolve: nslookup example.com.
Service answers: curl -sI https://example.com, then the first line.
On macOS
ifconfig, ping -c 3, nslookup and curl -sI work as they do on Linux; the gateway is on the default line of netstat -rn.
The same checks on Linux, Windows and macOS
| Check | Linux | Windows |
|---|---|---|
| Addresses | ifconfig | ipconfig /all |
| Routes and gateway | route -n | route print |
| Reachability | ping -c 4 <host> | ping -n 4 <host> |
| Path to a host | tracepath <host> | tracert <host> |
| Name resolution | nslookup <name> | nslookup <name> |
| Listening ports | netstat -tuln | netstat -an |
| Running processes | ps aux | tasklist |
| Disk space | df -h | Get-PSDrive |
| Recent errors | journalctl -p err -b | Get-WinEvent System -MaxEvents 20 |
| Time since boot | uptime | systeminfo (System Boot Time) |
Get-PSDrive and Get-WinEvent are PowerShell; the rest of the Windows column works in Command Prompt too.
macOS runs ifconfig, ping -c, nslookup, ps aux, df -h and uptime exactly as Linux does.
These are the ones that differ:
| Check | macOS |
|---|---|
| Routes and gateway | netstat -rn |
| Path to a host | traceroute <host> |
| Listening ports | lsof -iTCP -sTCP:LISTEN |
| Recent errors | log show --last 1h |
tracepath ships with iputils on Linux and needs no root, which is why it's here in place of traceroute, often not installed by default.
On newer Linux systems ip addr, ip route and ss -tuln replace ifconfig, route -n and netstat -tuln.
Reading the logs
Logs answer the question the symptom can't: what the system itself saw.
journalctl -p err -b on Linux lists every error-level message since the last boot, and the Windows System log does the same for drivers and services.
Two habits make them useful:
- Note the time the problem happened, then read the log around that time instead of from the top.
- Search for the exact error text you noted at the start. Someone has usually logged, filed or answered it before.
Common causes, by layer
| Layer | What it looks like | First check |
|---|---|---|
| Power and hardware | Nothing happens, or a device is missing | Is it connected, powered, and listed by the OS? |
| Connection | No network at all | Cable seated, Wi-Fi radio on, link light |
| Address | 169.254.x.x, or no address | Is the DHCP server reachable? |
| Route | Local network works, internet doesn't | ping the gateway, then an internet IP |
| Name resolution | IP addresses work, names don't | nslookup against the configured resolver |
| Service | One site or app fails, others work | Is the port open, is the service running? |
| Application | Only one program fails | Its own logs, settings and cache |
| Disk and memory | Everything is slow, saves fail | df -h, Task Manager, ps aux sorted by memory |
Dynamic Host Configuration Protocol (DHCP) is how a device gets its address automatically from the network, usually from the router.
Where this meets security
The same bottom-up checks are the first steps of incident response, the work of finding out what happened after something went wrong. An unexpected listening port, a process nobody recognises, a route that sends traffic somewhere new, or a resolver that changed overnight is a fault until proven otherwise, and sometimes it's an intruder. The commands are identical. The question changes: why did this change, and who changed it?
