ERROR CODES / ENGLISH

Unable to connect: ECONNREFUSED, ECONNRESET, ENOTFOUND

How to read the connection error code, check DNS and the Base URL, and find which layer of the network path is failing.

Reviewed 2026-11-13 · ERROR CODES / ENGLISH · Chinese detail: 完整中文页

What it means

The request never connected. The three acronyms point in different directions: ENOTFOUND means the domain cannot be resolved, ECONNREFUSED means the connection reached the host but no service is listening on the port, and ECONNRESET means the connection was established and then cut by the other side.

Error: connect ECONNREFUSED 127.0.0.1:443
Error: getaddrinfo ENOTFOUND api.example.com
Error: read ECONNRESET
curl: (7) Failed to connect to api.example.com port 443

Common causes

ShareCause
40%Base URL wrong (an extra or missing /v1)
25%The site's domain changed or the site is down
20%Proxy or firewall blocking
10%DNS pollution
5%Wrong port (http written as https)

How to confirm

Resolve the domain and make a verbose request:

nslookup api.example.com
curl -v https://api.example.com/v1/models

curl -v tells you where it stops: DNS, TCP, TLS, or HTTP.

Check the Base URL form:

WrongCorrect
https://api.example.comhttps://api.example.com/v1
https://api.example.com/v1/chat/completionshttps://api.example.com/v1
api.example.com/v1https://api.example.com/v1

The Base URL should stop at /v1 and must not include a specific endpoint. The client appends the endpoint itself.

Fix

Correct the Base URL first. If the domain does not resolve, fix DNS or the proxy configuration. If the port is wrong, match the scheme to the port. If the site's domain has changed, update the client to the current address.

If it still fails

SymptomResponsible party
curl -v stops at DNSYour network or DNS
Stops at the TLS handshakeCertificate or proxy
Connects, then immediately resetsSite or firewall
Browser opens the site, the program cannotThe program is not using the proxy

General guidance, not a statement about any specific provider. For measured data, see the relay directory and method.