Shared server guidance · Question & answer

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.

BeginnerWindows 11 with Microsoft OpenSSH Client; Windows PowerShell 5.1 or PowerShell 7 as labelledLinux VPS and dedicated servers where a remote Linux command is shown
Go to the answer

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.

Local Windows PowerShell
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.

Local Windows CMD
nslookup vps.example.com

This 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.

Local Windows PowerShell
ssh adminuser@203.0.113.10

Use 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.