Skip to content
RU

Error: connect ETIMEDOUT — Why the Connection Gets No Answer

What it means: Your connection attempt got no reply at all: packets were dropped or the host is unreachable.

  1. Check the IP and port in the error
  2. Test the port from another network
  3. Open the port in firewall and security group
  4. Verify the host is up
  5. Set a sensible client timeout

Test your URL now

Pings your host from our server, so you see whether it answers from outside your network.

Check your host & ports →

What ETIMEDOUT means

ETIMEDOUT is the system error «Connection timed out» (errno 110 on Linux). For a new connection, connect(2) returns it on a «Timeout while attempting connection»; on an established TCP connection, tcp(7) uses it when «The other end didn't acknowledge retransmitted data after some time.» In Node.js:

Error: connect ETIMEDOUT 203.0.113.10:443
  { errno: -110, code: 'ETIMEDOUT', syscall: 'connect', address: '203.0.113.10', port: 443 }

The Node.js docs describe it as «A connect or send request failed because the connected party did not properly respond after a period of time. Usually encountered by http or net.» The key word is no response. If the host had answered with a refusal you would get ECONNREFUSED immediately; a timeout means the SYN packets went unanswered.

How long it takes depends on who gives up first. The Linux kernel retransmits the initial SYN tcp_syn_retries times, 6 by default, «which corresponds to retrying for up to approximately 127 seconds» (tcp(7)). Libraries usually stop sooner: Node's built-in fetch() (undici) has a 10-second connect timeout and reports UND_ERR_CONNECT_TIMEOUT in error.cause.

Causes

CauseHow to recognise itFix
Firewall drops the trafficTimeout from outside, works from the server itselfAllow the port in iptables, nftables or the cloud firewall
Cloud security group or network ACLNew instance or new port; nothing in the server logsAdd an inbound rule for the port and source
Wrong or stale IP addressThe address in the error is not the server'sFix DNS or the configured address
Host down or unreachableNo ping, no ARP on the local networkBring the host back; check routing
Outbound egress blockedFails from one network or container onlyAllow egress to the port; check the proxy
Overloaded server, full backlogIntermittent timeouts under loadScale or raise the listen backlog
Idle connection silently dropped by NATETIMEDOUT on long-lived, idle connectionsEnable TCP keep-alive below the NAT idle timeout

Drop versus reject explains most cases. A firewall rule that drops packets leaves the client waiting until it times out; a rule that rejects answers at once, and the client sees a refusal. If you control the firewall and want fast failures for blocked ports, reject instead of drop.

Timeouts in your own code

Node.js has several timeouts with different meanings. socket.setTimeout() only reports idleness: «When an idle timeout is triggered the socket will receive a 'timeout' event but the connection will not be severed. The user must manually call socket.end() or socket.destroy()» (net docs). Forgetting to destroy the socket in that handler leaves requests hanging forever instead of failing. For outgoing calls, bound the whole request:

const res = await fetch('https://api.example.com/v1/items', {
  signal: AbortSignal.timeout(5000), // rejects with a TimeoutError after 5 s
});

For long-lived connections through NAT gateways or load balancers, enable keep-alive probes so idle connections are not silently dropped: socket.setKeepAlive(true, 30_000).

How to fix it

  1. Test the exact address and port from the machine that fails, with a short timeout:
    nc -vz -w 5 203.0.113.10 443
    curl -v --connect-timeout 5 https://api.example.com/
  2. Compare with another network. If it connects from your laptop but not from the server (or the reverse), the block is on the failing side's egress or the target's allow list.
  3. Check the address. dig +short api.example.com must return the IP in the error. An old IP in DNS or a hard-coded address sends traffic to a machine that is gone.
  4. Open the port on the target: host firewall (iptables -S, nft list ruleset, ufw status) and the cloud security group or network ACL.
  5. Trace the path when the host is remote: traceroute -T -p 443 203.0.113.10 shows where packets stop.
  6. Confirm the service listens on the target: ss -ltn 'sport = :443'. A listening service behind a dropping firewall still times out.

Chrome shows the same failure as ERR_CONNECTION_TIMED_OUT.

How to confirm the fix

nc -vz -w 5 api.example.com 443
# Connection to api.example.com 443 port [tcp/https] succeeded!
curl -sS -o /dev/null -w 'connect %{time_connect}s total %{time_total}s\n' https://api.example.com/

The connect time should be milliseconds, not seconds. The ping and port checker tests the host and port from our server, outside your network; the traceroute tool shows where the route stops.

Related errors

ICMP PingHost availability and latency
Port ScannerOpen TCP port detection
LatencyResponse time in milliseconds
Packet LossPercentage of dropped packets

Why teams trust us

ICMP+TCP
check protocols
14
key ports scanned
3,184
checks in 30 days
3
regions

How it works

1

Enter IP or domain

2

ICMP packets sent

3

Latency & packet loss shown

How Do Ping and Port Scanning Work?

Ping sends ICMP packets to a host and measures response time. Port scanning checks which TCP ports are open and accepting connections — helping diagnose serviceavailability issues.

Configurable Ping

Choose packet count (3, 4, 6, 10). Stats: min/avg/max latency and packet loss.

Common Port Scanner

Check 14 key ports: HTTP, HTTPS, SSH, FTP, SMTP, MySQL, PostgreSQL, and more.

Cloud-Based Check

Testing from our server — see site availability from outside, not just your local network.

Uptime Monitoring

Need constant monitoring? Create a monitor — checks every minute with notifications.

Who uses this

DevOps

availability diagnosis

Network engineers

TCP port scanning

Developers

connection debugging

SRE

basic health check

Common Mistakes

ICMP blocked = server is downMany servers block ICMP. Ping fails but site works — check ports instead.
High ping = server problemLatency depends on geography. 150ms between continents is normal, not an error.
Closed ports — cause for alarmClosed ports of unused services are good. Unnecessary open ports are a risk.
One check = sufficientNetworks are unstable. A single timeout ≠ a problem. Check multiple times or set up monitoring.

Best Practices

Combine ping and port checksPing shows host availability, ports show specific service availability. Use both.
Check from different locationsThe problem may be local. A cloud test shows the real picture.
Close unused portsEvery open port is a potential attack vector. Keep only necessary ports open.
Set up monitoringManual checks do not scale. Set up automated monitoring with notifications.

Get more with a free account

Ping check history, host availability monitoring and downtime alerts.

Sign up free

Learn more

Sources

Frequently Asked Questions

What is the difference between ETIMEDOUT and ECONNREFUSED?

ECONNREFUSED is an immediate answer that nothing listens on the port. ETIMEDOUT means no answer arrived at all, usually because a firewall drops the packets.

How long does Linux wait before connect ETIMEDOUT?

With the default tcp_syn_retries of 6, about 127 seconds. Most libraries and HTTP clients use a shorter connect timeout of their own.

Why does ETIMEDOUT happen on a cloud server I just created?

The security group or network ACL usually has no inbound rule for the port yet. Add one for the port and the source addresses.

Can ETIMEDOUT happen after the connection is open?

Yes. If the peer stops acknowledging data, for example after a NAT device drops an idle connection, the socket fails with ETIMEDOUT.

Try the live tool that powered this guide

Free plan — 10 monitors, checks every 5 min, no card required. Upgrade for 1-minute interval and multi-region monitoring.