This is an interesting one.
What is our hostname and ip ?
echo $hostname $(ipaddr)
TCA0080ALKVTAGB xx.xx.242.47
ping
works:
$ping $(hostname)
PING TCA0080ALKVTAGB (xx.xxx.242.47): 56 data bytes
64 bytes from xx.xxx.242.47: icmp_seq=0 ttl=64 time=0.049 ms
64 bytes from xx.xxx.242.47: icmp_seq=1 ttl=64 time=0.102 ms
ssh
does not: apparently gets lost in dns world (for same host):
$ssh $(hostname)
ssh: Could not resolve hostname tca0080alkvtagb: nodename nor servname provided, or not known
Note: we have already disabled ipv6
:
networksetup -setv6off Wi-Fi
This is on El Capitan
.
For the curious about ipaddr
:
$type ipaddr
ipaddr is a function
ipaddr ()
{
ifconfig -a | grep -A 6 en0 | grep "inet " | awk '{print $2}'
}
Oh! Let's not neglect to mention: ssh
with the ip addr does work:
ssh xx.xx.242.47
Last login: Mon Jan 16 12:24:08 2017 from xx.xx.242.47
Update
Telnet
works fine;
telnet $(hostname) 22
Here is `ssh -vvv $(hostname) output
$ssh -vvv $(hostname)
OpenSSH_6.9p1, LibreSSL 2.1.8
debug1: Reading configuration data /Users/boesc**/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: /etc/ssh/ssh_config line 56: Applying options for *
ssh: Could not resolve hostname tca0080alkvtagb: nodename nor servname provided, or not known
/Users/boesc**/.ssh/config
and/etc/ssh/ssh_config
?.ssh/config
. Please make an answer and I will award. Actually .. no .. I renamed.ssh/config
and still same behavior. And likewise for/etc/ssh/ssh_config
ssh -vvv -F /dev/null $(hostname)
.