Applications can use the methods getLocalHost
, getByName
, and getAllByAddress
to create a new NbtAddress instance. This class is symmetric with
About NetBIOS: The NetBIOS name service is a dynamic distributed service that allows hosts to resolve names by broadcasting a query, directing queries to a server such as Samba or WINS. NetBIOS is currently the primary networking layer for providing name service, datagram service, and session service to the Microsoft Windows platform. A NetBIOS name can be 15 characters long and hosts usually registers several names on the network. From a Windows command prompt you can see what names a host registers with the nbtstat command.
C:\>nbtstat -a 192.168.1.15 NetBIOS Remote Machine Name Table Name Type Status --------------------------------------------- JMORRIS2 <00> UNIQUE Registered BILLING-NY <00> GROUP Registered JMORRIS2 <03> UNIQUE Registered JMORRIS2 <20> UNIQUE Registered BILLING-NY <1E> GROUP Registered JMORRIS <03> UNIQUE Registered MAC Address = 00-B0-34-21-FA-3B
The hostname of this machine is JMORRIS2
. It is a member of the group(a.k.a workgroup and domain) BILLING-NY
. To obtain an
InetAddress addr = NbtAddress.getByName( "jmorris2" ).getInetAddress();
From a UNIX platform with Samba installed you can perform similar diagnostics using the nmblookup
utility.