Domain Name System

Domain Name System 


import java.net.*;

class dns
{
     public static void main(String args[]) throws Exception
     {
          try
          {
              InetAddress addr = InetAddress.getByName("www.drranurekha.com");
              System.out.println(addr);
          }

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



/*

sample output:

D:\cnlab>javac dns.java
D:\cnlab>java dns
www.drranurekha.com/160.153.137.167

D:\cnlab>

*/

No comments:

Post a Comment

Don't be a silent reader...
Leave your comments...

Anu