Quit watching curl fail in silence when you have no idea why

Networking & Firewall (Ss/Netstat/Iptables/Nftables/Curl)

Quit watching curl fail in silence when you have no idea why

🧩 The Challenge

Everyone has had that moment where a curl request hangs forever or fails with some generic error while the server owner swears the port is open. It’s infuriating when you suspect a firewall is eating your packets but you don’t have the tools to prove it.

💡 The Fix

Use curl with the trace-time and verbose flags to dump the exact socket handshake timing to stderr. It tells you immediately if you’re getting stuck at the DNS lookup, the TCP connect, or waiting for the server to actually spit out data.

curl -v --trace-time http://example.com/api/v1/health

⚙️ Why It Works

Adding that flag injects a timestamp before every single line of the verbose output, which lets you see exactly how many milliseconds the system spent sitting in limbo waiting for a response. If that number jumps between the connect phase and the request headers, you know you’ve got a packet drop or a back-end app that’s choking.

🚀 Pro-Tip: Pipe it into 2>debug.log if you need to share the output with a dev who refuses to believe the network is the problem.

Linux Tips & Tricks | © ngelinux.com | 11/12/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted