Is there any way to resolve hostnames from IPs, similar to the way nmblookup resolves IPs from names? I've been trying to create a Perl script which parses the logs of a webserver, and ran into a stumbling block because gethostbyaddr() doesn't work. Any suggestions? Is there some deep, dark helpfile I have yet to uncover? Thanks, matt ---- Autodesk, Inc. ----
On Fri, 24 Oct 1997, Matt Lavallee wrote:> Is there any way to resolve hostnames from IPs, similar to the way > nmblookup resolves IPs from names?nmblookup -S (node status) should help, there, with a NetBIOS name of *<0> i think. but you might have to work on nmblookup.c a bit. luke
> > Date: Thu, 23 Oct 1997 21:23:48 -0400 > From: "Matt Lavallee" <Matt.Lavallee@autodesk.com> > To: "'samba@samba.anu.edu.au'" <samba@samba.anu.edu.au> > Subject: nmblookup and resolutions > Message-ID: <01BCDFF9.F3F1EBA0.matt.lavallee@autodesk.com> > > Is there any way to resolve hostnames from IPs, similar to the way > nmblookup resolves IPs from names? >I can tell you that it is really a pain. I have just spent a week in front of the sniffer trying to do this. But I do have some code that may do what you want. First the warnings; because of the way that NetBIOS runs (responds to port 137), you can't run this on a machine that is running samba. Second, the PC must be running and on the net to respond to the query. Third, this must be run as root or with the sticky bit set (that port 137 thing). Fourth this code is at the best alpha. Contact me if you are still interested. *** Andrew/Luke/Jeremy/Developers/Anyone *** Can a WINS server provide an inverse query response ? I know that a WINS server running DNS would but how about without DNS ? Jeff Foster. jfoste@wgc.woodward.com