Java Program for Domain name service (DNS)

10:23 PM
import java.net.*;



class dns
{

public static void main(String args[]) throws Exception
{

try
{
InetAddress[] address=InetAddress.getAllByName("java.sun.com");

for(int j=0;j System.out.println(address[j]);
}

catch(Exception e)
{
System.out.println("Error in accessing Internet :"+e);
}

}
}

0 Comments