Kevin,

Funny you should mention this. I looked at this problem--let me phrase it as 
'how do I
find the "NetBIOS name of a machine give its IP'--and didn't get to the 
solution.
However, here's what I found. The NetBT protocol for looking up names uses the 
same
packet format as DNS, but uses different "commands" and of course uses a 
different
port. The 'Status' command asks a node to report what 'names' it claims to have 
(which
make be group names or node names). I wrote a piece of code to make this 
request but
got stuck because machines wouldn't report their name unless I already knew it 
and
stuck it in the right place in the protocol. Later, however, I discovered that 
NT and
win95 has a program nbtstat.exe which is able to do this. Now all that remains 
is to
sniff the packet and find out what's in there and then add this to my c++ code. 
If
you'd like the code let me know.

Kevin Traas wrote:

> I'm working on a custom PERL script here to do some reporting on Internet
> usage, etc.  However, I'm running into a minor problem.
>
> I can monitor Internet usage by IP address; however, we're using DHCP here
> and IP addresses might change for the systems on my internal net.  The other
> issue is that a report full of IP addresses isn't as easy to read as one
> that could have the NetBIOS names in their place.
>
> A real drastic solution I have to this is to use PERL to access the WINS
> database stored on my NT Server to map IP's and NetBIOS names, but I'm
> thinking that there's *got* to be an easier way.
>
> If you have any suggestions or clues or know of any docs, faqs, howtos that
> might help me out, please let me know.
>
> Much appreciated.
>
> Kevin Traas
>
> --
> E-mail the word "unsubscribe" to [EMAIL PROTECTED]
> TO UNSUBSCRIBE FROM THIS MAILING LIST. Trouble?  E-mail to [EMAIL PROTECTED] .



--
Jens B. Jorgensen
[EMAIL PROTECTED]



--
E-mail the word "unsubscribe" to [EMAIL PROTECTED]
TO UNSUBSCRIBE FROM THIS MAILING LIST. Trouble?  E-mail to [EMAIL PROTECTED] .

Reply via email to