NAME RESOLUTION PROTOCOL
Code:
import java.io.*;
import java.net.*;
class NameResolution {
public static void main(String[] args)
{
try {
// IP Address
InetAddress addr
= InetAddress.getByName("23.229.203.68");
// Host name
System.out.println("Host name is: "
+ addr.getHostName());
// Host Address
System.out.println("Ip address is: "
+ addr.getHostAddress());
}
catch (UnknownHostException e) {
System.out.println(e);
}
}
}
Output:
I have never seen such a perfect solution. thank you maa'm
ReplyDeletemaa'm can i perform this practical on multiple machines?
ReplyDelete