scp not able to resolve dns name

1.2k Views Asked by At

Question first: Does anyone know why scp won't resolve the dns name wheezy to the ip address 192.168.164.144 while ping does?

Explanation & Details second:

While on OS Mavericks I could scp files from my terminal to my VMWare Fusion Debian instance just fine. I just had to make sure that the ip address and machine name (wheezy) were in both the Debian /etc/hosts file and in the /etc/hosts file of my mac.

However after upgrading to Yosemite I can't scp files to my virtual host using the domain name. I CAN scp files to the virtual machine if I specify the ip address. So this works:

scp test_file.txt [email protected]:~/

but this does not:

scp test_file.txt dan@wheezy:~/

This boggles my mind because the host "wheezy" pings just fine:

BASHdan@DanRauxa ~ >>ping wheezy
PING wheezy (192.168.165.144): 56 data bytes
64 bytes from 192.168.165.144: icmp_seq=0 ttl=64 time=0.335 ms
64 bytes from 192.168.165.144: icmp_seq=1 ttl=64 time=0.337 ms
64 bytes from 192.168.165.144: icmp_seq=2 ttl=64 time=0.290 ms
^C
--- wheezy ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.290/0.321/0.337/0.022 ms

and my /etc/hosts file is actually identical on both the Yosemite and Wheezy machine:

127.0.0.1   localhost
192.168.165.1 DanRauxa
192.168.165.144 wheezy 
127.0.0.1       drupal-7-31.local
127.0.0.1       drupal8devprep.local

Does anyone know why scp won't resolve the dns name wheezy to the ip address 192.168.164.144 while ping does?

Many thanks. -d-

1

There are 1 best solutions below

1
On BEST ANSWER

Check your ~/.ssh/config to see if there is a wheezy host in there.

Also run the scp in verbose mode:

scp -v test_file.txt dan@wheezy:~/.

Might give you more information on where the failure is happening.