ssh cannot resolve host name (but host, ping and nslookup can)
I have recently upgraded from Snow Leopard (10.6.8) to El Capitan (10.11.6)
and the following problem has been present under both OSX versions.
ssh is unable to resolve ONE PARTICULAR host name:
$ ssh myserver1.mylab.mydomain
nc: getaddrinfo: nodename nor servname provided, or not known
ssh_exchange_identification: Connection closed by remote host
On the other side, host, ping and nslookup are able to resolve the
name of this host correctly.
Using the IP address for that host, I am able to access it with ssh.
The weird thing is that ssh has this problem only for this one particular
host. If I try to ssh to other nodes in the same domain or anywhere
else, I have no problem logging in with the host name.
Other programs using ssh (Transmit, x2go) have the same problem,
I have to use the IP address to be able to access this host.
I have tried after browsing a bit for similar problems to flush the DNS cache using:
$ sudo dscacheutil -flushcache
$ sudo killall -HUP mDNSResponder
But it did not help. As only one particular host is affected, I guess the
wrong information must be stored somewhere and needs to be deleted,
but I don't manage to find where.
Any suggestion will be most welcome.
MacBook Pro, OS X El Capitan (10.11.6)