Re: nslook problem?

James Song (jsong@nlc.com)
Fri, 24 Mar 95 20:59:23 PST

> Hi!>
> James> Nslook returned an error message saying "can not lookup" this
> James> device. But I wrote a small program to use gethostbyname() to
> James> query the IP address and the program successfully got the IP
> James> address.
>
> Juergen> I don't think that there is anything in scotty that
> Juergen> should be able to change the behaviour of
> Juergen> gethostbyname().
>
> James> Since I really want the functionality in tkined, I copied the
> James> whole function into tkined and it worked all right there.
>
> Lightbulb lit. Scotty links with -lresolv, tkined does not and i guess
> your testprogram was linked without libresolv too.
>
> gethostbyname() from your libc probably looks into /etc/hosts or do
> NIS lookups (maybe in conjunction with DNS lookups, if not found in
> local databases).
>
> And i guess gethostbyname() from your libresolv always asks DNS.
>
>
> Guess: maybe you are working with SunOS 4.1.x and a patched shared
> libc (with resolv+-2.0 or alike) but not with a patched libresolv ?
>
> Erik
>

Yes, I am working with SunOS 4.1.x. But I don't know anything about the
status of the libraries. Does a patched libresolv have the gethostbyname
that functions properly? Or is the function in libresolv supposed to work
this way? Anyway, it has been an interesting experience. I will explore more.
I really appreciate all the helps.

Best regards,
--James