I would like to get the ip address of a .local hostname, so I can ssh into it, seems like host hostname.local does not work in this scenario
ssh [email protected] does not work, so I am trying to get ssh [email protected] instead.
The command I found which will convert a .local hostname (not dns) to an ip address is the humble ping command.
Heres the results of ping
PING 5153F344.local (192.168.8.105) 56(84) bytes of data.
64 bytes from 192.168.8.105: icmp_seq=1 ttl=64 time=0.524 ms
--- 5153F344.local ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.524/0.524/0.524/0.000 ms
This is one of the many variants of my failing solution:
# Note trying not to use single quotes so I can turn all these commands into an alias:
DEV_TERM_IP="$(ping -c 1 5153F344.local) | cut -d \"(\" -f2 | cut -d \")\" -f1 | echo"
ssh "me@$DEV_TERM_IP.local"