import java.net.*;
public class NSLookup {
public static void main (String args []) {
if (args.length == 0) {
System.out.println ("Pemakaian: java NSLookup
System.exit(0);
}
String host = args[0];
InetAddress address = null;
try {
address = InetAddress.getByName (host);
} catch (UnknownHostException e) {
System.out.println ("invalid IP - malformed IP");
System.exit (0);
}
byte [] ip = address.getAddress ();
for (int i=0; i
System.out.print ((ip[i]) & 0xff);
}
System.out.println();
}
}
Berikut adalah output program setelah dirunning menggunakan command prompt :
Tidak ada komentar:
Posting Komentar