When Ping Lies
Lesson 17 of 47 in Coddy's Networking with the Terminal course.
Ping is the first thing everyone reaches for, and it answers a narrower question than people think. It tells you the machine is alive. It says nothing about whether the thing you actually want is running.
A server can answer every ping perfectly while the web server on it has crashed. The machine is up; the service is down. Ping cannot see the difference, because it never talks to the service.
It lies in the other direction too. Plenty of hosts are configured to ignore ICMP entirely, so ping reports 100 percent loss for a machine that is serving traffic happily. A failed ping is not proof that anything is wrong.
So ping is step one of a ladder, never the whole diagnosis. Step two is asking the port itself.
Challenge
MediumShow the exact situation ping cannot see: a machine that answers, with nothing serving on the port.
Against 127.0.0.1, and starting no server at all:
- Ping once and print
host up - Check port 9999 with
nc -zand printport closed
Expected output:
host up
port closedThe machine is obviously alive. That is exactly the point: alive is not the same as serving.
Try it yourself
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Networking with the Terminal
4Is It Reachable?
ICMP and pingReading Ping OutputWhen Ping LiesRefused or Timed OutRecap: ReachabilityPractice on your own: Terminal playground