Program : Domain name service (DNS)
By : Kapil Lohia
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<address.length;j++)
System.out.println(address[j]);
}
catch(Exception e)
{
System.out.println("Error in accessing Internet :"+e);
}
}
} |
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<address.length;j++)
System.out.println(address[j]);
}
catch(Exception e)
{
System.out.println("Error in accessing Internet :"+e);
}
}
}
Editorial Team
We are a group of young techies trying to provide the best study material for all Electronic and Computer science students. We are publishing Microcontroller projects, Basic Electronics, Digital Electronics, Computer projects and also c/c++, java programs.