Why aren't host names showing up with ssh?

Why aren't host names showing up with ssh?

Post by Tristan Mille » Thu, 13 Apr 2006 05:25:38



Greetings.

I have a bunch of GNU/Linux machines set up on a local network through a
peripheral router.  IP addresses are assigned statically rather than by
DHCP.  The router has a built-in DNS server which I've used to assign
names to the computers on the Intranet:

10.0.0.2 router.example.com
10.0.0.3 foo.example.com
10.0.0.4 bar.example.com

So far so good.  When I'm on foo, I can type "ping bar", and that works, so
obviously the router is properly handling the host names.

I can also type "ssh bar" from foo to get a remote shell on bar.  However,
it annoys me that when I type "who", "finger", "last", or any other
command that is supposed to list incoming connections, it lists only the
IP address (10.0.0.3), not the host name (foo or foo.example.com):


Login: joe                              Name: Joe User
Directory: /home/joe                    Shell: /bin/bash
On since Tue Apr 11 20:56 (BST) on pts/5 from 10.0.0.3


joe      pts/5        10.0.0.3         Tue Apr 11 20:56   still logged in

On every other system I've worked with, such commands show the host name
instead of the IP address.  Is there something I haven't properly
configured here or is my router misbehaving?

Regards,
Tristan

--
   _
  _V.-o  Tristan Miller [en,(fr,de,ia)]  ><  Space is limited
 / |`-'  -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  <>  In a haiku, so it's hard
(7_\\    http://www.nothingisreal.com/   ><  To finish what you

 
 
 

Why aren't host names showing up with ssh?

Post by Dave Uhrin » Thu, 13 Apr 2006 05:40:27



> Greetings.

> I have a bunch of GNU/Linux machines set up on a local network through a
> peripheral router.  IP addresses are assigned statically rather than by
> DHCP.  The router has a built-in DNS server which I've used to assign
> names to the computers on the Intranet:

> 10.0.0.2 router.example.com
> 10.0.0.3 foo.example.com
> 10.0.0.4 bar.example.com

> So far so good.  When I'm on foo, I can type "ping bar", and that works, so
> obviously the router is properly handling the host names.

Well, it's handling the name -> IP address resolution anyway.

Quote:> I can also type "ssh bar" from foo to get a remote shell on bar.  However,
> it annoys me that when I type "who", "finger", "last", or any other
> command that is supposed to list incoming connections, it lists only the
> IP address (10.0.0.3), not the host name (foo or foo.example.com):

Because your "DNS" does not do inverse resolution, i.e., IP Address -> name

Quote:> On every other system I've worked with, such commands show the host name
> instead of the IP address.  Is there something I haven't properly
> configured here or is my router misbehaving?

Fix your /etc/hosts files or configure your "DNS" to perform inverse
lookup.

 
 
 

Why aren't host names showing up with ssh?

Post by Dave Uhrin » Thu, 13 Apr 2006 06:33:07



> Greetings.

> I have a bunch of GNU/Linux machines set up on a local network through a
> peripheral router.  IP addresses are assigned statically rather than by
> DHCP.  The router has a built-in DNS server which I've used to assign
> names to the computers on the Intranet:

> 10.0.0.2 router.example.com
> 10.0.0.3 foo.example.com
> 10.0.0.4 bar.example.com

> So far so good.  When I'm on foo, I can type "ping bar", and that works, so
> obviously the router is properly handling the host names.

Well, it's handling the name -> IP address forward resolution anyway.

Quote:> I can also type "ssh bar" from foo to get a remote shell on bar.  However,
> it annoys me that when I type "who", "finger", "last", or any other
> command that is supposed to list incoming connections, it lists only the
> IP address (10.0.0.3), not the host name (foo or foo.example.com):

Because your "DNS" does not do inverse resolution, i.e., IP Address -> name

Quote:> On every other system I've worked with, such commands show the host name
> instead of the IP address.  Is there something I haven't properly
> configured here or is my router misbehaving?

Fix your /etc/hosts files or configure your "DNS" to perform inverse
lookup.
 
 
 

Why aren't host names showing up with ssh?

Post by Keith Kelle » Thu, 13 Apr 2006 06:43:13



Quote:

> I have a bunch of GNU/Linux machines set up on a local network through a
> peripheral router.  IP addresses are assigned statically rather than by
> DHCP.  The router has a built-in DNS server which I've used to assign
> names to the computers on the Intranet:

> 10.0.0.2 router.example.com
> 10.0.0.3 foo.example.com
> 10.0.0.4 bar.example.com

> So far so good.  When I'm on foo, I can type "ping bar", and that works, so
> obviously the router is properly handling the host names.

> I can also type "ssh bar" from foo to get a remote shell on bar.  However,
> it annoys me that when I type "who", "finger", "last", or any other
> command that is supposed to list incoming connections, it lists only the
> IP address (10.0.0.3), not the host name (foo or foo.example.com):

Well, the obvious question (and I hope not too obvious), does name
resolution work on bar?  Just because ping bar from foo works doesn't
mean ping foo from bar works.  If ping foo from bar doesn't work, I'd
suspect /etc/resolv.conf on bar.  If ping foo from bar does work, then
perhaps there's something in sshd_config that is causing problems?

--keith

--

(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom
see X- headers for PGP signature information

 
 
 

Why aren't host names showing up with ssh?

Post by Tristan Mille » Thu, 13 Apr 2006 06:43:04


Greetings.


> Because your "DNS" does not do inverse resolution, i.e., IP Address ->
> name

>> On every other system I've worked with, such commands show the host name
>> instead of the IP address.  Is there something I haven't properly
>> configured here or is my router misbehaving?

> Fix your /etc/hosts files or configure your "DNS" to perform inverse
> lookup.

I don't see any setting for inverse lookup in the router's configuration
page -- I guess that feature is not supported.  As you said, I could
manually specify the names in /etc/hosts, but that sort of defeats the
purpose of DNS. :(

Regards,
Tristan

--
   _
  _V.-o  Tristan Miller [en,(fr,de,ia)]  ><  Space is limited
 / |`-'  -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  <>  In a haiku, so it's hard
(7_\\    http://www.nothingisreal.com/   ><  To finish what you

 
 
 

Why aren't host names showing up with ssh?

Post by Dave Uhrin » Thu, 13 Apr 2006 06:57:42



> Greetings.


>> Because your "DNS" does not do inverse resolution, i.e., IP Address ->
>> name

>>> On every other system I've worked with, such commands show the host name
>>> instead of the IP address.  Is there something I haven't properly
>>> configured here or is my router misbehaving?

>> Fix your /etc/hosts files or configure your "DNS" to perform inverse
>> lookup.

> I don't see any setting for inverse lookup in the router's configuration
> page -- I guess that feature is not supported.  As you said, I could
> manually specify the names in /etc/hosts, but that sort of defeats the
> purpose of DNS. :(

The RFCs for DNS only require "forward" lookup.  Inverse lookup is
completely optional and remember also that the router was designed for
Windose lusers who do not use protocols which work best with inverse
lookup enabled and configured.

Populate your /etc/hosts files and your login waits will also decrease by
about 30 seconds.

 
 
 

Why aren't host names showing up with ssh?

Post by Jeremiah DeWitt Weine » Thu, 13 Apr 2006 23:54:59



> Because your "DNS" does not do inverse resolution, i.e., IP Address -> name

        That's _reverse_ resolution, not "inverse".  Confusingly enough, DNS
seems to have originally included something called "inverse querying",
but going from IP to name is generally known as reverse.

--
Oh to have a lodge in some vast wilderness.  Where rumors of oppression
and deceit, of unsuccessful and successful wars may never reach me
anymore.  
        -- William Cowper

 
 
 

Why aren't host names showing up with ssh?

Post by Dave Uhrin » Fri, 14 Apr 2006 00:23:30




>> Because your "DNS" does not do inverse resolution, i.e., IP Address -> name

>    That's _reverse_ resolution, not "inverse".  Confusingly enough, DNS
> seems to have originally included something called "inverse querying",
> but going from IP to name is generally known as reverse.

I suppose then that we need to change this (from BIND 9 Configuration
Reference (p38 of 39):

   +-------------------------------+
   |$ORIGIN|2.1.10.in-addr.arpa    |
   |-------+-----------------------|
   |3      |IN PTR foo.example.com.|
   +-------------------------------+
to

   +-------------------------------+
   |$ORIGIN|2.1.10.rev-addr.arpa   |
   |-------+-----------------------|
   |3      |REV PTR foo.example.com.|
   +-------------------------------+

While ISC does use the term "reverse name resolution" the title of the
chapter is:  6.3.4. Inverse Mapping in IPv4

 
 
 

Why aren't host names showing up with ssh?

Post by Ken Sim » Fri, 14 Apr 2006 02:05:47


Hi Dave -



Quote:>I suppose then that we need to change this (from BIND 9 Configuration
>Reference (p38 of 39):

>   +-------------------------------+
>   |$ORIGIN|2.1.10.in-addr.arpa    |
>   |-------+-----------------------|
>   |3      |IN PTR foo.example.com.|
>   +-------------------------------+
>to

>   +-------------------------------+
>   |$ORIGIN|2.1.10.rev-addr.arpa   |
>   |-------+-----------------------|
>   |3      |REV PTR foo.example.com.|
>   +-------------------------------+

According to my BIND book, that IN stands for INternet, not INverse.

PTR (PoinTeR) is what makes it inverse/reverse.

--
Ken
http://www.kensims.net/

 
 
 

Why aren't host names showing up with ssh?

Post by Dave Uhrin » Fri, 14 Apr 2006 02:24:32



> According to my BIND book, that IN stands for INternet, not INverse.

> PTR (PoinTeR) is what makes it inverse/reverse.

Indeed, my mistake there.  It's been a couple of years since I set up some
nameservers.
 
 
 

Why aren't host names showing up with ssh?

Post by Tristan Mille » Fri, 14 Apr 2006 09:21:47


Greetings.


>> I don't see any setting for inverse lookup in the router's configuration
>> page -- I guess that feature is not supported.  As you said, I could
>> manually specify the names in /etc/hosts, but that sort of defeats the
>> purpose of DNS. :(

> The RFCs for DNS only require "forward" lookup.  Inverse lookup is
> completely optional and remember also that the router was designed for
> Windose lusers...

This is true.  In fact, the HTML manual provided on CD-ROM was not viewable
on anything other than Internet Explorer for MS-Windows owing to its use
of malformed URLs (e.g., use of \ instead of /) and assumption of
case-insensitive filenames (e.g., links to "foo.htm" when the file was
really named "FOO.HTM").  I reported this problem to the manufacturer and
their response indicated that they had no clue what I was talking about.
("Gee, the CD-ROM documentation works for all of our other customers.
Maybe your computer is broken?")

regards,
Tristan

--
   _
  _V.-o  Tristan Miller [en,(fr,de,ia)]  ><  Space is limited
 / |`-'  -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  <>  In a haiku, so it's hard
(7_\\    http://www.nothingisreal.com/   ><  To finish what you

 
 
 

Why aren't host names showing up with ssh?

Post by Dave Uhrin » Fri, 14 Apr 2006 10:04:22




>> The RFCs for DNS only require "forward" lookup.  Inverse lookup is
>> completely optional and remember also that the router was designed for
>> Windose lusers...

> This is true.  In fact, the HTML manual provided on CD-ROM was not viewable
> on anything other than Internet Explorer for MS-Windows owing to its use
> of malformed URLs (e.g., use of \ instead of /) and assumption of
> case-insensitive filenames (e.g., links to "foo.htm" when the file was
> really named "FOO.HTM").  I reported this problem to the manufacturer and
> their response indicated that they had no clue what I was talking about.
> ("Gee, the CD-ROM documentation works for all of our other customers.
> Maybe your computer is broken?")

LOL!!!

Your other option is to configure BIND on one of your systems and point
the /etc/resolv.conf files on the others to that host.  In fact it would
not be too much more involved to set up a DHCP server on that system and
configure DDNS.  That would permit the occasional connection of a guest
Windows laptop without having to reconfigure the laptop.

 
 
 

Why aren't host names showing up with ssh?

Post by Jeroen Geilma » Tue, 18 Apr 2006 03:02:47



> Greetings.

> I have a bunch of GNU/Linux machines set up on a local network through a
> peripheral router.  IP addresses are assigned statically rather than by
> DHCP.  The router has a built-in DNS server which I've used to assign
> names to the computers on the Intranet:

> 10.0.0.2 router.example.com
> 10.0.0.3 foo.example.com
> 10.0.0.4 bar.example.com

> So far so good.  When I'm on foo, I can type "ping bar", and that works, so
> obviously the router is properly handling the host names.

> I can also type "ssh bar" from foo to get a remote shell on bar.  However,
> it annoys me that when I type "who", "finger", "last", or any other
> command that is supposed to list incoming connections, it lists only the
> IP address (10.0.0.3), not the host name (foo or foo.example.com):


> Login: joe                              Name: Joe User
> Directory: /home/joe                    Shell: /bin/bash
> On since Tue Apr 11 20:56 (BST) on pts/5 from 10.0.0.3


> joe      pts/5        10.0.0.3         Tue Apr 11 20:56   still logged in

> On every other system I've worked with, such commands show the host name
> instead of the IP address.  Is there something I haven't properly
> configured here or is my router misbehaving?

If the router is supposed to be functioning as a DNS server then check this:

$nslookup foo
$nslookup bar
$nslookup

The output should tell you how it got that information.

J

 
 
 

Why aren't host names showing up with ssh?

Post by Raqueeb Hassa » Tue, 18 Apr 2006 21:29:52


Quote:> $nslookup foo
> $nslookup bar
> $nslookup

Yes, that should tell you how it is done!

--
Raqueeb Hassan
Bangladesh