The Network Commands and the Five-Step Connectivity Test
Where you are: Module 7 — Essential Diagnostic Tools · Lesson 7.2 · Based on Chapter 7 (§7.3) of Dr. Tahseen Al Doori's Troubleshooting Essentials.
What you'll be able to do
- State the purpose of each essential network command and what to look for in its output.
- Run the book's five-command connectivity sequence and explain what each step proves.
- Use the first failing step to say where a network fault lies.
- Find the equivalent command on Windows, macOS and Linux.
Watch: The Network Commands and the Five-Step Connectivity Test
The video runs the commands on a fictional Windows laptop, then follows a test packet along the network path: from the computer itself, to the router, out to the internet and finally to a name lookup. Watch where the first failure appears. Keep these questions in mind:
- Why does the sequence start with the computer talking to itself?
- What does an address beginning 169.254 tell you?
- If you can reach 8.8.8.8 but not a website by name, which part of the path is at fault?
The essential network commands
| Command | Purpose | What to look for |
|---|---|---|
ipconfig /all (Windows) · ip addr (Linux) · ifconfig (macOS) | Show IP configuration | A valid IP address, subnet mask, default gateway and DNS servers. An address beginning 169.254 means no reply from the DHCP server. |
ping | Test reachability | Replies with low, stable times. "Request timed out" means no response. |
tracert (Windows) · traceroute (Linux, macOS) | 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. |
Adapted from the book's Table 7.3.
Some definitions. An IP address identifies a device on a network. The subnet mask says which addresses are local. The default gateway is the router that carries traffic off the local network. DHCP (Dynamic Host Configuration Protocol) hands out addresses automatically; when a computer asks and nobody answers, Windows gives itself a 169.254.x.x address, which cannot reach the internet. DNS (Domain Name System) translates names such as example.com into IP addresses.
Beyond the book (2026 note): Microsoft's documentation confirms the details you will rely on most. ipconfig with no parameters shows the IPv4 and IPv6 addresses, subnet mask and default gateway for each adapter; /all adds the full configuration, including DNS servers. Microsoft calls the 169.254 behaviour Automatic Private IP Addressing (APIPA). ping sends four echo requests by default; if pinging an IP address works but pinging a name does not, Microsoft states you may have a name resolution problem. In tracert, a row of asterisks can simply mean that a router does not answer these probes, so judge a path by where replies stop for good, not by one silent hop. Sources: ipconfig · ping · tracert — Microsoft Learn
The five-command connectivity sequence
This is the most important procedure in the chapter. Run the commands in this order and stop at the first one that fails:
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?
What each step proves:
ping 127.0.0.1— 127.0.0.1 is the loopback address: the computer talking to itself. Replies prove that the networking software (the TCP/IP stack) is working. Failure here means a software problem on this computer, not the network.ipconfig— confirms the computer has a valid address and knows its gateway. A 169.254 address, or "Media disconnected", stops you here: look at the cable, Wi-Fi connection and DHCP.pingthe default gateway — use the gateway address shown in step 2 (for example 192.168.1.1). Replies prove the local link to the router works.ping 8.8.8.8— a well-known public address on the internet. Replies prove traffic can leave your network and return. Failure, with step 3 working, points beyond the router: the router's internet connection, the modem or the provider.ping google.com— the same idea, but by name. If step 4 works and step 5 fails, the fault is name resolution (DNS).
The book's insight is that each command tests one more part of the path, and the first command that fails shows where the fault lies. This is the half-split idea from Module 6 applied to a network: rather than testing everything, each step rules out a whole section of the path.
The same tasks on other platforms
| Task | Windows | macOS | Linux |
|---|---|---|---|
| Show IP configuration | ipconfig /all | ifconfig | ip addr |
| 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 |
Adapted from the book's Appendix C.
Beyond the book (2026 note): On Linux, the netstat manual page itself describes the program as "mostly obsolete" and names ss as its replacement; in ss -tuln, the options mean TCP, UDP, listening sockets only and numeric output. Linux and macOS ping keep sending until you press Ctrl+C; add -c 4 on Linux to send four requests and stop. On a Mac, the same information is also shown in System Settings > Network, select the service, Details > TCP/IP, where Renew DHCP Lease appears when the service uses DHCP. Sources: netstat(8) · ss(8) · ping(8) — man7.org · Change TCP/IP settings on Mac — Apple Support
ipconfig /release discards the computer's address and disconnects it from the network until /renew succeeds. Practise it only on a lab machine or virtual machine, never on a computer you are connected to remotely, and never on a shared system without permission.
Worked example
(Fictional scenario.) A student's laptop shows it is connected to the campus Wi-Fi, but no website opens.
| Step | Command | Result | Conclusion |
|---|---|---|---|
| 1 | ping 127.0.0.1 | Four replies, time<1ms | Stack works |
| 2 | ipconfig | IPv4 address 169.254.37.112, no default gateway | First failure |
There is no need to run steps 3–5: without a valid address and gateway they cannot succeed. The 169.254 address says the laptop asked for an address and received no reply from DHCP. Theories now focus on the Wi-Fi association and the DHCP service. The student forgets the network and rejoins it; ipconfig then shows 192.168.20.57 with gateway 192.168.20.1, and steps 3, 4 and 5 all succeed. The ticket records the first failing step, the fix and the verification.
Try it
The read-only commands are safe on your own computer; the cable test is best done on a lab machine.
- Run
ipconfig /all(orip addr/ifconfig). Record your IP address, subnet mask, default gateway and DNS servers. - Run the five-command sequence, using your own gateway address in step 3. Record the result of each step.
- Run
nslookupfor a site you use and record the address returned. - On a lab machine: disconnect the network cable (or turn off Wi-Fi) and repeat the sequence. Record exactly which step fails first and what the output said.
Completion criteria: a table of five steps with results for the working connection, and a second table showing the first failing step after disconnection, with one sentence explaining why that step failed.
Knowledge check
ipconfig shows the address 169.254.12.8. What is the most likely meaning?
ping 8.8.8.8 succeeds but ping google.com fails. Where is the fault?
Steps 1 and 2 succeed, but ping to the default gateway times out. What should you investigate next?
Why does the sequence begin with ping 127.0.0.1?
Answers explained — 1: 169.254 means DHCP did not answer; DNS, router load and provider outages do not produce that address. 2: reaching the internet by IP proves the path works, so only name resolution remains. 3: the first failure is between the computer and its router, so the local link and settings come before DNS, servers or the provider. 4: 127.0.0.1 is loopback, so it tests only the local stack; the other options describe different commands.
Key takeaways
ipconfig(orip addr/ifconfig) shows whether a device has a valid address, gateway and DNS servers; 169.254 means no DHCP reply.ping,tracert/traceroute,nslookupandnetstat -antest reachability, path, names and connections.- The five-command sequence tests one more part of the path at each step; the first failure shows where the fault lies.
- The sequence is the half-split method applied to the network path.
Sources
- Dr. Tahseen Al Doori — Troubleshooting Essentials, University Edition (2026), §7.3 and Appendix C
- ipconfig — Microsoft Learn
- ping — Microsoft Learn
- tracert — Microsoft Learn
- netstat(8) — man7.org
- ss(8) — man7.org
- ping(8) — man7.org
- Change TCP/IP settings on Mac — Apple Support
