|
-
August 24th, 1999, 10:21 PM
#1
DNS through java
I am behind a proxy and want to find the IP no. of an Internet addresses.
I wrote the following :
public class DNS
{ public static void main(String args[])
{ System.getProperties().put( "proxySet", "true" );
System.getProperties().put( "proxyHost", "proxy compu." );
System.getProperties().put( "proxyPort", port );
try
{ InetAddress add=InetAddress.getLocalHost();
String name="www.yahoo.com";
InetAddress newad=InetAddress.getByName(name);
System.err.println("IP no. of "+name+" is : "+newad);
}
catch(Exception e)
{ e.printStackTrace(); }
}
}
This is giving :
java.net.UnknownHostException: www.yahoo.com
This was somewhat expected. But is there a way by which I can use a DNS server
in my network directly through the prog. and get my reply ? I know the IP no.
of the DNS server.
Regards. Samik.
Please Email a copy of reply to [email protected]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|