import java.net.*;
import java.io.*;
public class IPofHost{
public static void main(String args[])throws Exception{
String hostname;
System.out.print("Enter Domain Name :");
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
hostname=in.readLine();
try{
InetAddress ip=InetAddress.getByName(hostname);
System.out.println("IP Address :"+ip);
}
catch(Exception e){
System.out.println("Host Not Found");
}
}
}
import java.io.*;
public class IPofHost{
public static void main(String args[])throws Exception{
String hostname;
System.out.print("Enter Domain Name :");
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
hostname=in.readLine();
try{
InetAddress ip=InetAddress.getByName(hostname);
System.out.println("IP Address :"+ip);
}
catch(Exception e){
System.out.println("Host Not Found");
}
}
}
No comments:
Post a Comment