Re: Q about "netdb hosts" command ?

Juergen Schoenwaelder (schoenw@gaertner.de)
Thu, 24 Apr 1997 12:40:01 +0200

Damien Wetzel <d.wetzel@fr.cis.philips.com> said:

Damien> I m using scotty 2.1.5 on SunOs 4.1.3
Damien> I m trying to understand how the netdb hosts works
Damien> my /etc/hosts is 3 lines :
Damien> 192.2.3.66 sut1
Damien> 192.2.3.1 mcx2
Damien> 192.2.4.1 mcx2-wan

Damien> when i type netdb hosts , i got a huge list of {name,ipaddress} so
Damien> i guess it is the result of ypcat hosts. the command is ok

Damien> then i try
Damien> "netdb hosts address sut1" i got
Damien> unknown IP host name "sut1"

Damien> "netdb hosts address anyname_from_the_huge_list_above" i got
Damien> unknown IP host name "anyname_from_the_huge_list_above"

Damien> so my question is :did i misunderstand something ?

No. The `netdb host' command is just a wrapper around gethostbyname(),
gethostbyaddr() and gethostent(). The behaviour (whether it reads
/etc/hosts or from a NIS server) depends on your system configuration.
You example looks strange, even if your system is configured to use
NIS. However, it is difficult to guess what goes wrong here. You may
want to look at tnm/generic/tnmNetdb.c and tnm/generic/tnmUtil.c in
order to find out whether the problem is in the scotty code or in your
C library.
Juergen

-- 
Juergen Schoenwaelder     <schoenw@gaertner.de>     (Tel: +49-531-23873-0)
Gaertner Datensysteme, Hamburger Strasse 273a, 38114 Braunschweig, Germany
--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.