Domain name suffix woes

Martin Rys spleefer90 at gmail.com
Fri Mar 3 00:29:11 AEDT 2017


Thanks for the input and explanation, I changed the names so they start
with a letter.

Martin

On Thu, Mar 2, 2017 at 2:24 PM, Nico Kadel-Garcia <nkadel at gmail.com> wrote:

> On Thu, Mar 2, 2017 at 7:09 AM, Darren Tucker <dtucker at zip.com.au> wrote:
> > On Thu, Mar 2, 2017 at 10:46 PM, Martin Rys <spleefer90 at gmail.com>
> wrote:
> > [...]
> >> `ssh user at 330` - That gets me an error:
> >> ssh: connect to host 330 port 22: Invalid argument
> >>
> >> 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?
> >
> > not really, the behaviour in question is in they system libraries,
> > which think it's an IP address (single numeric, number.number and
> > octal are all valid but uncommon representations of IP addresses).
> >
> > $ gethostip localhost
> > localhost.localdomain 127.0.0.1 7F000001
> >
> > $ gethostip 330
> > 330 0.0.1.74 0000014A
> >
> > $ telnet 330
> > Trying 0.0.1.74...
> > telnet: connect to address 0.0.1.74: Invalid argument
> >
> > You can work around it with an entry in ~/.ssh/config:
> >
> > Host 300
> >    Hostname 330.blah.domain.com
>
> Note that SSH is hardly the only tool vulnerable to t his problem.
> This is why most of us never use raw numbers as shortened hostnames,
> even if it is convenient on occasion.
>


More information about the openssh-unix-dev mailing list