Raconn - Ssh multi hostname
25 points by izissise
25 points by izissise
Neat, HPN-SSH has a patch for limited happy eyeballs support: https://github.com/rapier1/hpn-ssh/blob/0a878a79785b66275041e771f140af8b23bd2683/happyeyeballs.c which sort of overlaps with this.
For some of the things here it is also possible to use Match LocalNetwork in ~/.ssh/config to adjust hostnames, etc. I do this so that I use internal addresses if I'm at home. But I do like this approach can result in less configuration.
This is the first I've heard of match localnetwork, cool! It looks like it was introduced in OpenSSH 9.4, in 2023.
you could accomplish something similar using match host in your ssh config, eg: try to connect to yourhost.local first, otherwise connect to yourhost.com:
match host yourhost exec "ping -c1 -t3 yourhost.local"
hostname yourhost.local
host yourhost
hostname yourhost.com