javaandroidhostnamefqdnnetbios

Ip address to NetBIOS/FQDN name in Java/Android


given the ip address of a computer on the same network of my Android device, i have to find its NetBIOS/FQDN name ... is there any "clean" solution to accomplish this with the Android SDK and generally speaking in java ?

Obviously InetAddress.get*HostName does not return the NetBIOS name :)


Solution

  • You can use JCIFS open source library.

     InetAddress addr = NbtAddress.getByName( "hostname" ).getInetAddress();
    

    works both ways, ip address to hostname and vice versa.