The same request instead hangs and ends with `curl: (28) Failed to connect to 10.0.1.20 port 8080 after 130000 ms: Connection timed out`. How is this different from "refused"?
BeginnerTroubleshootingNetworking, DNS and firewalls
Answer
Likely causes → Packets are silently dropped: a firewall/security group with DROP, wrong routing, host down, or the SYN-ACK can't get back (asymmetric routing).
Diagnose →
ping -c3 10.0.1.20
traceroute -T -p 8080 10.0.1.20
# on the server: are SYNs arriving?
sudo tcpdump -ni any 'tcp port 8080 and tcp[tcpflags] & tcp-syn != 0'
Fix → If no SYNs arrive, fix the security group, NACL or network firewall upstream. If SYNs arrive but no reply leaves, check the host firewall and return routes.
Prevent → Remember the rule: refused means you reached the host; timeout means something dropped the packets.
More on 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`.Beginner`ping google.com` fails with `ping: google.com: Temporary failure in name resolution`, but `ping 8.8.8.8` works.Beginner`dig api.internal` works, but the application and `curl` fail with `Could not resolve host: api.internal`.Intermediate`/etc/resolv.conf` changes you made disappear after a reboot or a few minutes.BeginnerDNS lookups take exactly 5 seconds before succeeding.IntermediateShort names like `db01` don't resolve, but `db01.corp.example.com` does.Beginner