What's changed: Initial version
5.3Basic diagnostic commands and interpreting results
Covers when to use the staple commands—ping for reachability, ipconfig (Windows) / ifconfig and ip (Linux) for local IP settings, tracert/traceroute to trace the path, and nslookup for name resolution—plus correctly interpreting results, such as how a firewall blocking ICMP can make ping fail even though the host is actually reachable.
Against a complaint of "no connection," the first hands-on way to gather facts is the basic diagnostic commands. ping, ipconfig/ifconfig/ip, tracert/traceroute, and nslookup—available on every OS—each check a different layer and viewpoint. What matters is less being able to type the command than how you read the result. In particular, when a firewall blocks specific traffic, a command may display "failure" while the host is in fact reachable—a discrepancy. This section covers when to use each command and the correct interpretation, including such result pitfalls.
5.3.1When to use each staple command
- ping checks L3 reachability to a target using ICMP. If a reply returns, you also see the round-trip time (RTT). It is the first move to see "does it even reach?" Pinging an IP like
ping 8.8.8.8separates out the effect of name resolution. - ipconfig (Windows) / ifconfig and ip (Linux/mac) show your own IP settings (IP address, subnet mask, default gateway, etc.). Use them first to check "do I even have a correct IP?" and "is the gateway set?"
- tracert (Windows) / traceroute (Linux/mac) trace the path (hops) one by one to a destination. Seeing which router it reaches and where it stops narrows down "where along the way it is broken." nslookup checks whether name resolution (DNS)—host name to IP—works correctly.
5.3.2Interpreting results and the effect of firewalls
- If a firewall blocks ICMP,
pingtimes out (fails) even when the target is healthy. So "ping fails" does not necessarily mean "down." A web server replying on 443 but not to ping is a classic case. - The symptom "reachable by IP but not by name" (
ping 8.8.8.8works butping example.comfails) points to a name-resolution (DNS) problem, not reachability. Herenslookupisolates whether DNS resolves. tracert/traceroutemay show just that hop as*(no reply) if a router along the way is set not to return ICMP—yet that is not necessarily a fault. The essence of interpretation is to not take a "failure" display at face value and to judge together with other means.
Most-tested: the division of roles—ping = L3 reachability via ICMP; ipconfig/ifconfig/ip = local IP settings; tracert/traceroute = path hops; nslookup = DNS name resolution—and the interpretations "a firewall blocking ICMP can make ping fail while the host is reachable" and "reachable by IP but not by name = a DNS problem." Do not take a failure display at face value.
A user reports "I cannot reach the new internal web server." You first ping the server, but there is no reply and it times out. Concluding "ping fails, so the server is down" is a classic interpretation error, because many servers and firewalls deliberately block responses to ICMP (the protocol ping uses) for security. So next you check whether the actual service, HTTPS (TCP 443), works via a browser or another means, and the web page opens fine—meaning the server is up and ping failed only because a firewall was stopping ICMP. Consider another case. If a user says "ping 8.8.8.8 works but ping internal-server-name fails," reachability itself is alive and the suspect is the host-name-to-IP conversion—name resolution (DNS). Running nslookup internal-server-name to see whether a correct IP returns isolates whether it is a DNS problem. Further, if "it goes partway but breaks beyond a certain site," you use tracert/traceroute to see which hop it stops at. Consistently, the key is to not swallow a command's "failure" whole, but to corroborate why that result occurred with another means. Rather than jumping on the result of a single ping, combine commands of different viewpoints to build up facts—ipconfig for your own settings, nslookup for name resolution, tracert for the path—which is the diagnostic manner worth acquiring even at the introductory stage.
| Command | What it checks | Main viewpoint/layer |
|---|---|---|
| ping | Whether it reaches (ICMP reachability, RTT) | L3 reachability |
| ipconfig / ifconfig / ip | Own IP, mask, gateway settings | Local IP configuration |
| tracert / traceroute | The path to a destination (where it stops) | Path (per hop) |
| nslookup | Host-name-to-IP name resolution (DNS) | Name resolution (DNS) |
Trap: "If ping gets no reply, the target must be down" is wrong—when a firewall blocks ICMP, ping times out even on a healthy server while real services like HTTPS still reach. Also wrong: "reachable by IP but not by name means a physical link fault"—that is a name-resolution (DNS) problem, isolated with nslookup.
5.3.3Section summary
- ping = ICMP reachability, ipconfig/ifconfig/ip = local IP settings, tracert/traceroute = path, nslookup = DNS resolution—each a different viewpoint
- A firewall blocking ICMP can make
pingfail while still reachable—do not take a failure display at face value - Reachable by IP but not by name is a DNS problem—combine commands of different viewpoints to build up facts
Sign in to track progress — Log in.
Quick check
(just a quick review)Q1. Pinging an internal web server times out with no reply, yet the browser opens the server's web page (HTTPS) with no problem. Which interpretation of this situation is most appropriate?
Q2. On a user device, `ping 8.8.8.8` (by IP) succeeds but `ping example.com` (by name) fails. Which cause should be isolated first as most appropriate?
Q3. You first want to confirm "whether my device has a correct IP address and default gateway." Which command is most appropriate on Windows?
Keep track of your progress
The full study guide is free to read. Sign up free to practice with the question bank, track what you have read, review your mistakes, and highlight passages.

