Stop relying on ping to tell you if a service is actually alive
Networking & Firewall (Ss/Netstat/Iptables/Nftables/Curl)
Stop relying on ping to tell you if a service is actually alive
🧩 The Challenge
You’ve got a service that responds to pings perfectly fine, but the actual application port is totally dead or firewalled off. I’ve wasted half an hour rebooting servers only to realize the app daemon died while the host stayed up.
💡 The Fix
Use curl to verify the specific application handshake instead of just checking if the server is powered on. It tells you immediately if the network path is blocked or the service isn’t listening.
curl -v -m 5 --connect-to ::<destination-ip> http://<hostname>:<port>
⚙️ Why It Works
By overriding the address in the curl command, you force the connection to hit the target IP on the specific port you care about, regardless of what DNS says or what the local routing table thinks. It bypasses the “everything looks fine” illusion that ICMP gives you.
🚀 Pro-Tip: Use the -I flag if you don’t want to download the entire response body, just the headers.
Linux Tips & Tricks | © ngelinux.com | 10/25/2026
