curl: (6) Could not resolve host
The hostname doesn't resolve
Seen in curl, wget ("unable to resolve host address")
DNS returned no address for the name, or the resolver could not be reached.
Common causes
- A typo in the hostname.
- The record does not exist or has been removed (NXDOMAIN).
- The machine has no working DNS resolver (VPN, container, offline).
How to fix it
- Check the spelling and that the record exists.
- Look up the name against a public resolver to compare.
- Check /etc/resolv.conf or the VPN's DNS settings.
Got a different message? Paste it into the error explainer.
Related errors
- unable to get local issuer certificate · The client can't find the certificate's issuer
- unable to verify the first certificate · The intermediate certificate is missing
- certificate has expired · The server certificate has expired
- self signed certificate in certificate chain · The chain ends in an untrusted root
- wrong version number · TLS spoken to something that isn't TLS
- curl: (7) Failed to connect · The connection was refused or unreachable
- curl: (28) Operation timed out · The request timed out
- curl: (51) SSL: no alternative certificate subject name matches target host name · The certificate doesn't match the hostname
- curl: (3) URL using bad/illegal format or missing URL · curl could not parse the URL
- curl: (18) transfer closed with outstanding read data remaining · The connection closed before the body finished
- curl: (22) The requested URL returned error · The server answered with an HTTP error status
- curl: (35) SSL connect error · The TLS handshake failed