On 12/12/20 3:50 AM, asymptosis wrote:>> Having both IPv4 and IPv6 address defined for a specific Host would be > > How would your client know which one to go to? > > Say I had: > > Host foo > Hostname 192.168.2.2 192.168.2.3 > > Do I end up at 192.168.2.2 randomly half the time, and 192.168.2.3 the rest of the time? >Actually this is about providing an IPv4 and IPv6 address in parallel, but its not uncommon to have several IP addresses in the same AF bound to the same host name in DNS. In this case it might be reasonable to look at the subnets of the local network interfaces. If the ssh config file on your laptop says (for example) Host foo Hostname 192.168.1.2 10.10.0.4 and your host has a local IP address 10.10.0.5/24, its pretty obvious which IP address ssh should connect to. Of course I understand that this code is not in. Its just an example to show that having multiple IP addresses on the Hostname line (or a hostname mapping to multiple IP addresses) is not unreasonable. Regards Harri
> Say I had: > > Host foo > Hostname 192.168.2.2 192.168.2.3 > > Do I end up at 192.168.2.2 randomly half the time, and 192.168.2.3 the > rest of the time?I find the man page unambiguous: HostName specifies the singular real host name to log into.? Alternatively, a singular IP address is permitted. I can see how "Numeric IP addresses are also permitted" could be construed as meaning multiple addresses on the one line, but, that's an incorrect reading.? It really means, IP addresses can be used in HostName entries. All of this fails to help the original question, which is how to specify multiple IP addresses.? The obvious answer to that is to put multiple A records into your local DNS.? If you don't have a local DNS or have no control over it, specify multiple Hosts in your config, one for each IP address.