Interview Prep/Linux/Networking, DNS and firewalls

`curl http://10.0.1.20:8080` returns `curl: (7) Failed to connect to 10.0.1.20 port 8080: Connection refused`.

BeginnerTroubleshootingNetworking, DNS and firewalls
Answer

Likely causes → The host is reachable but nothing listens on that port/IP (service down, bound to 127.0.0.1 only), or a firewall rule actively rejects with a TCP RST/ICMP.

Diagnose →

# on the server
sudo ss -tlnp | grep 8080              # listening? on 0.0.0.0 or 127.0.0.1?
systemctl status myapp
sudo nft list ruleset | grep -i reject

Fix → Start the service, or change its bind address to 0.0.0.0/the right interface; remove the reject rule if it's wrong.

Prevent → Health checks that test from outside the host, not just localhost.

All Linux questions Roadmap: Linux

More on Networking, DNS and firewalls