@ Deprecated public static String [ ] getHosts ( String strInterface , String nameserver ) throws UnknownHostException { String [ ] ips = getIPs ( strInterface ) ; Vector < String > hosts = new Vector < String > ( ) ; for ( int ctr = 0 ; ctr < ips . length ; ctr ++ ) try { hosts . add ( reverseDns ( InetAddress . getByName ( ips [ ctr ] ) , nameserver ) ) ; } catch ( Exception e ) { } if ( hosts . size ( ) == 0 ) return new String [ ] { InetAddress . getLocalHost ( ) . getCanonicalHostName ( ) } ; else return hosts . toArray ( new String [ ] { } ) ; }
Returns all the host names associated by the provided nameserver with the address bound to the specified network interface