issue with name resolution

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
dear all,

I have a slackware 10.2 box, and a remote linux box I want  login to.

Here my problems:

traceroute [remote-hostname]  -> no problems
ssh [remote-ip-address]     -> works without problems

ssh [remote-hostname]     -> connection fails, with a time out error
By logging the ssh messages, I found out that it tries to connect to
host [], i.e. it wrongly resolvs the host.

However, if I do

host [remote-hostname]  -> ok

and then

ssh [remote-hostname] -> ok

ssh works; it seems that it uses same cache of host resolution.

Can you explain me how to fix the hostname resolution?

best regards


Re: issue with name resolution

Quoted text here. Click to load it

Is the reverse DNS for your host correct? And it's unclear to me whether you
are checking the logs on your client, or on the SSH serving host, and what
you are actually seeing. Can you post the logs?

Re: issue with name resolution

I am on the client side.

I have found out that:

(a) my ssh client do work correctly with ip-addresses, but wrongly with
By using ssh <hostname> -v, I discovered that it tries always to
connect to address
Then, it returns a "connection time out" message

(b)if I reboot the client machine in windows, I reach the remote
machine via ssh (providing indifferently hostname, or ip-address)
without problems

(c)in linux, if I do
host <hostname>

and then

ssh <hostname>

then ssh works.

thanks all for suggestions

Re: issue with name resolution

Quoted text here. Click to load it

I'm wondering if something along the line is misinterpretting a
"-1" meaning failure as an IP address.  Do you have the name service
cache (nscd) running, and if so does stopping it make any difference?

Do you have multiple nameservers listed in /etc/resolv.conf and do they
all work?  What SSH software and version is this?

I suspect that strace'ing ssh during the failure will provide a clue as
to where the bogus address is coming from.

Darren Tucker (dtucker at
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.

Site Timeline