ping and traceroute on Mac: Diagnose Network Issues
When pages won't load, the useful question isn't "is the internet down" — it's where it's down. ping tells you whether a machine answers and how fast; traceroute shows every router between you and it. With those two commands you can usually name the failing layer in under a minute.
Test reachability with ping
# Send 5 pings and stop
ping -c 5 1.1.1.1
# Ping by name — this also exercises DNS
ping -c 5 apple.com
Each reply prints a time= value in milliseconds — the round trip from your Mac to that machine and back. Without -c, ping runs until you press Control–C. What to look for in the summary:
- Packet loss — 0% is normal. The occasional lost packet on Wi-Fi happens; consistent loss of a few percent or more means real trouble.
- Latency — under ~20 ms to a nearby server is typical on a wired or healthy Wi-Fi connection. Steady numbers matter more than low ones: 40 ms every time is fine, 15 ms spiking to 400 ms is not.
- "Request timeout" — the machine didn't answer at all. If every ping times out, that target (or your path to it) is unreachable.
One caveat before you declare a site dead: ping uses ICMP, and some servers and firewalls deliberately ignore it while serving web traffic perfectly well. A single unresponsive target proves little — try a second one before concluding anything. On the flip side, a long-running ping is a great live Wi-Fi meter: leave ping 1.1.1.1 going while you walk around with your MacBook and watch the latency and loss rise in the dead spots.
Trace the path with traceroute
# Show every router hop between you and the destination
traceroute apple.com
Each numbered line is one router along the path, with three response times per hop. Hop 1 is your own router; the next few belong to your ISP; the rest are the wider internet. Two things trip people up when reading it:
- A
*is not automatically a failure. Many routers deprioritize or ignore traceroute probes. A hop of asterisks in the middle, with later hops responding normally, means that router is just quiet — the path is fine. - Look for where things change and stay changed. Latency that jumps at hop 3 and remains high through the rest of the trace points at the link between hops 2 and 3. Responses that stop entirely and never resume mark where the path dies.
Isolate the failing layer
The real diagnostic power is running ping against three targets in order:
- Ping your router. Find its address under System Settings → Wi-Fi → Details… → TCP/IP (usually something like
192.168.1.1). If this fails, the problem is your Wi-Fi or local network — the internet beyond it is irrelevant. - Ping
1.1.1.1. If the router answers but a public IP doesn't, the problem sits with your modem or ISP. - Ping
apple.com. If IPs work but names fail with "cannot resolve", the network is fine and DNS is broken — flush the cache or change resolvers rather than rebooting the router.
That three-step ladder — local, internet, DNS — turns "the internet feels broken" into a specific, fixable diagnosis. If the results seem inconsistent, repeat the ladder on Ethernet or from a spot next to the router: intermittent Wi-Fi can make any single run misleading, and confirming a failure twice is what separates a real diagnosis from a coincidence.
While you're troubleshooting, Mainspring handles the tuning: it turns 90+ hidden macOS settings into labelled, reversible toggles — every change one click on, one click back off.
Try Mainspring free →Signed & notarized by Apple · 1-day free trial · $29 once
If DNS turned out to be the culprit
Step 3 failing while steps 1 and 2 pass is the classic sign of a resolver problem. Before blaming your ISP's DNS forever, try changing your Mac's DNS servers to a public resolver like 1.1.1.1 or 8.8.8.8 — it's a two-minute change in System Settings and often fixes both reliability and speed.