How to Track Down an Internet Problem with Network Diagnostic Commands

Work through these in order and you will usually land on exactly where the problem is.

  1. Start by checking your own IP address (ipconfig / ifconfig)

    On Windows, run ipconfig in Command Prompt; on Mac or Linux, run ifconfig (or ip a) in a terminal, to see your device IP address, subnet mask, and default gateway. If your IP address starts with 169.254, that is a sign your device never got a real address from the router (an APIPA self-assigned address), so check the connection itself first.

  2. Ping the router (gateway) to check that connection

    Run ping [gateway IP] using the default gateway address you just found. A normal reply means your device and router are talking to each other fine; no reply at all points to a problem with the wired or wireless connection, or the router itself.

  3. Check the connection out to the internet (e.g. ping 8.8.8.8)

    Ping a well-known external IP address to check whether the internet connection itself is working at all. If pinging a public IP succeeds but pinging a domain name (like ping example.com) fails, that narrows the problem down specifically to DNS.

  4. Trace the path to see exactly where it breaks (tracert / traceroute)

    On Windows, run tracert [address]; on Mac or Linux, run traceroute [address], to see each hop along the way to the destination and how long each one takes to respond. A hop where response time suddenly spikes or stops entirely is a strong clue about where the delay or failure is actually happening.

  5. Check domain name resolution (nslookup)

    Running nslookup [domain] shows which IP address a domain resolves to and which DNS server answered. If only one specific site will not load and this result looks off, trying a different DNS server is worth testing.

  6. Check your current connections (netstat)

    Running netstat -an lists the network connections your device currently has open along with which ports are listening. An unusually large number of connections, or connections from an unfamiliar program, can be a sign worth a closer security check.

Reading the results as a sequence, not in isolation

The real value of this list is not any single command -- it is how the results build on each other. Gateway ping working but external ping failing points squarely at your provider's line rather than your home network; external ping working but a domain-name ping failing narrows things to DNS specifically. Each step is really there to rule things in or out for the next one.

When to reach for a deeper tool instead

These commands are enough to narrow a problem down to a general area -- your device, your router, your provider line, or DNS -- but they do not always explain exactly why. Once tracert shows a specific hop is slow, a dedicated deep dive into that step, or a full packet capture, is the natural next move rather than continuing to guess from ping results alone.

Frequently Asked Questions

I typed the command and nothing useful shows up.

On Windows, you need to open "Command Prompt" from the Start menu; on Mac, open the "Terminal" app. Some firewalls or security software also block ping responses outright, so a lack of response from one particular site can sometimes be that site own configuration rather than your connection.

Do I need to go through every single step?

No. Work through them in order and stop as soon as you find where things break down. For example, if the gateway ping succeeds but the external ping fails, it is more efficient to focus on the internet line itself rather than continuing through the remaining steps.