As a beginner in networking and platform engineering, there are five Linux commands that I must understand deeply:
pingip addrsscurldig
I realized that troubleshooting isn’t about memorizing commands — it’s about understanding where the problem lives.
ping — Is the Server Reachable?
ping helps answer the most basic question:
Can I reach this machine?
Example:
ping 8.8.8.8
If I get replies, network connectivity exists.
If I get timeouts, the issue could be routing, firewall rules, or the server being down.
This is usually my first troubleshooting step.
ip addr — Who Am I on the Network?
Before checking anything else, I need to know:
- Do I have an IP address?
- Is my interface up?
- What subnet am I in?
ip addr
If there’s no IP address assigned, nothing else will work.
This command confirms my server’s identity in the network.
ss — Is the Service Listening?
Even if the network works, the application might not be running.
ss -tuln
If I expect a web server on port 80:
ss -tuln | grep 80
If nothing shows up, the service is not listening.
This helps me determine whether the issue is network-related or application-related.
curl — Is the Application Responding?
ping checks connectivity.
curl checks whether the application responds.
curl http://localhost:80
Possible results:
- HTML output → Service is working
- Connection refused → Service not running
- Timeout → Network or firewall issue
This is how I test APIs and web services directly.
dig — Is DNS Working?
Sometimes the network is fine, but domain names don’t resolve.
dig google.com
If I see an IP address in the answer section, DNS is working.
If not, the issue may be DNS configuration.
When something breaks, I should think like this:
- Do I have an IP? →
ip addr - Can I reach the target? →
ping - Is DNS resolving? →
dig - Is the service listening? →
ss - Is the application responding? →
curl
Top comments (2)
Essential commands indeed! A good flow like this makes troubleshooting efficient. Have you considered using
tracerouteas an additional step whenpingfails? It can reveal where connectivity issues are occurring. Understanding the journey packets take is just as crucial! 🛣️traceroutedepends on ICMP responses at each hop, and many hops simply drop ICMP. Especially outside a data center context. Personally, I'd rather runmtrfor ~10 minutes from both sides. MTR is essentially traceroute + continuous ping in a loop, so it aggregates packet loss and latency stats per hop over time. Much better for diagnosing intermittent issues than a single traceroute snapshot.