Site icon New Generation Enterprise Linux

Stop wondering why your application cant reach the database

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

Stop wondering why your application cant reach the database

đź§© The Challenge

Everything looks fine in your config file, but your app still throws connection timeouts like it’s going out of style. You’ve checked the firewall rules three times and you’re starting to question your own sanity.

đź’ˇ The Fix

Use curl with the specific verbose flag to watch the handshake happen in real time. It bypasses your app’s internal logic and shows you exactly where the connection hits a wall.

curl -v telnet://your-db-host:5432

⚙️ Why It Works

By hitting the port directly through telnet-mode, you’re confirming if the network path is actually open without dealing with protocol-specific authentication failures. If this hangs, you know your firewall or routing is the culprit, not your code.

🚀 Pro-Tip: Stick this in your bashrc as an alias called checkport and save your eyes the trouble.

Linux Tips & Tricks | © ngelinux.com | 10/10/2026

0 0 votes
Article Rating
Exit mobile version