Why does SSH say it could not resolve the hostname?
SSH could not translate the destination name into a usable address, or the intended alias was not loaded. This happens before server authentication. Confirm the hostname and client alias settings before treating it as a server outage.
Instructions
1. Inspect an intended SSH alias
If you used a short name such as example-server, verify whether SSH has a matching Host entry.
ssh -G example-server | Select-String -Pattern "^hostname |^port |^user "If HostName remains example-server unexpectedly, check the user configuration filename and location.
2. Query the real DNS name
Use the actual fully qualified hostname supplied for the server.
nslookup vps.example.comThis queries DNS for the name. Compare the answer with the expected server address.
3. Separate DNS and reachability
If authorised connection details include a verified IP, a direct connection can help isolate DNS. Host verification must still succeed for that endpoint; an IP connection can have a separate known-host record.
ssh adminuser@203.0.113.10Use only the verified server IP. A successful IP connection suggests that name resolution or alias configuration needs attention.
Check the result
- The effective HostName is the intended fully qualified name or IP.
- DNS returns the expected address and SSH connects to the verified host.
Troubleshooting
- DNS returns NXDOMAIN
- Check spelling, DNS publication and whether the name is internal to a required VPN.
- DNS resolves a different address
- Confirm any migration or stale record before connecting; do not accept an unexpected host key.
Official references
Use the documentation for your installed version when a flag, service name or platform feature differs.
