Domain name suffix woes

Philipp Marek philipp.marek at linbit.com
Thu Mar 2 23:05:28 AEDT 2017


> I'm assuming that when the hostname is pure number, it ignores domain
> suffix. As just a number cannot be an actual IP, could this behavior be
> fixed in OpenSSH?
A number _is_ (or can be) a valid IPv4.

    $ perl -e 'print gethostbyname(shift)."\n"' 65.65.65.65
    AAAA
    $ perl -e 'print gethostbyname(shift)."\n"' 1094795585
    AAAA

You can leave out parts of the IP address:

    $ perl -e 'print gethostbyname(shift)."\n"' 65.65 | hd
    00000000  41 00 00 41 0a                                    |A..A.|

See also 
http://serverfault.com/questions/638260/is-it-valid-for-a-hostname-to-start-with-a-digit 
for some more discussion and links.



More information about the openssh-unix-dev mailing list