how can i find out a netbios name from an IP address.

Jens B. Jorgensen jjorgens at bdsinc.com
Tue Dec 15 19:20:50 GMT 1998


You're in luck! I once was desirous of just such a thing myself and since it didn't
exist (but I knew this was possible since you can do it in NT) I went ahead and wrote
one myself. It's command line and you give it the IP of the machine and it spits out
the name. Actually I added a few more possibilities into it. I'll be happy to send you
source but you'll need egcs and STL support since it's written in C++ and uses STL
collection classes. As a bonus I'll include my "wins proxy" daemon which I use to
allow my computer access to WINS servers I need without having my computer try to
register itself with that server, etc. etc. (Useful to a truly limited set of people,
granted.) I've created classes which encapsulate the netbios-ns message and the
questions and resource records. Actually I think it's a pretty slick set of objects.
I'll email you the tar.gz of the source.

Craig Sanders wrote:

> i install quite a few (debian linux) internet gateway boxes with samba
> installed so that the client can get their /var/www directory in network
> neighbourhood.
>
> in order to diagnose network faults (i.e "WTF can't the stupid doze boxes
> see/login to/etc the samba share?"), i often need to find out the netbios
> name of a machine.  for some reason this seems to an extraordinarily
> difficult thing to find out if you don't already known it...
>
> given that:
>
> a) i don't have a windows machine,
> b) i don't want no stinking GUI tool,
> c) i'm usually not on site (logged in with ssh),
>
> how can i find out the netbios name of a machine when i have it's IP
> address?
>
> can samba do it?  smbclient doesn't want to do anything unless i already
> know the name.
>
> are there any other tools that can do it?  nat (part of the smb-nat
> package) sometimes works, but only if nmbd isn't running...wierd.  nat
> also tries to do too much...all i want is the netbios name, i don't want
> it to try it's lame cracking attempts.
>
> (at worst, i suppose i could hack the source of nat so that it just does
> what i want.  nat10 is GPL code, based on samba.)
>
> any pointers to command line tools which would be useful to a unix geek
> would be very much appreciated.
>
> thanks,
>
> craig
>
> --
> craig sanders

--
Jens B. Jorgensen
jjorgens at bdsinc.com




More information about the samba mailing list