| | |
DNS: TRACERT , Java Network Programming
![]() |
•
•
Join Date: Dec 2004
Posts: 3
Reputation:
Solved Threads: 0
i am trying to interrogate root DNS servers, using " TRACERT " but after going to first hop i am getting " Request timed out "
please help.
code is as follows
import java.net.*;
import java.io.*;
class Whois extends Thread
{
public String traceCmdUnix = "tracert -h 10 ;
private StringBuffer result = null;
private void pingCmd (String command)
{
result = new StringBuffer ();
try {
Process p;
p = Runtime.getRuntime().exec(command);
readResult(p.getInputStream());
p.destroy();
}
catch (Exception e) {
e.printStackTrace();
}
}
private void readResult (InputStream in)
{
String line = null;
BufferedReader br = new BufferedReader(new InputStreamReader(in));
try {
while (!this.isInterrupted() &&
(line = br.readLine()) != null)
{
//this.doResultLine(line+"\n");
System.out.println(line);
}
}
catch (IOException e) {
e.printStackTrace();
}
finally {
try {
br.close();
}
catch (IOException e) {
}
}
if (this.isInterrupted())
System.out.println("*** Canceld ***");
}
public static void main (String args[]) throws Exception
{
Whois MyObj = new Whois();
MyObj.traceCmdUnix = MyObj.traceCmdUnix + " " + "www.yahoo.com" ;
MyObj.pingCmd(MyObj.traceCmdUnix);
}
}
OUTPUT:----->
C:\>tracert -d 5 -w 600 www.yahoo.com
Tracing route to www.yahoo.akadns.net [68.142.226.39]
over a maximum of 30 hops:
1 <10 ms <10 ms <10 ms 10.129.210.100
2 * * * Request timed out.
3 * * * Request timed out.
4 * * * Request timed out.
5 * * * Request timed out.
6 * * * Request timed out.
7 * * * Request timed out.
8 * * * Request timed out.
9 * * * Request timed out.
10 * * * Request timed out.
plz help
Thanks
please help.
code is as follows
import java.net.*;
import java.io.*;
class Whois extends Thread
{
public String traceCmdUnix = "tracert -h 10 ;
private StringBuffer result = null;
private void pingCmd (String command)
{
result = new StringBuffer ();
try {
Process p;
p = Runtime.getRuntime().exec(command);
readResult(p.getInputStream());
p.destroy();
}
catch (Exception e) {
e.printStackTrace();
}
}
private void readResult (InputStream in)
{
String line = null;
BufferedReader br = new BufferedReader(new InputStreamReader(in));
try {
while (!this.isInterrupted() &&
(line = br.readLine()) != null)
{
//this.doResultLine(line+"\n");
System.out.println(line);
}
}
catch (IOException e) {
e.printStackTrace();
}
finally {
try {
br.close();
}
catch (IOException e) {
}
}
if (this.isInterrupted())
System.out.println("*** Canceld ***");
}
public static void main (String args[]) throws Exception
{
Whois MyObj = new Whois();
MyObj.traceCmdUnix = MyObj.traceCmdUnix + " " + "www.yahoo.com" ;
MyObj.pingCmd(MyObj.traceCmdUnix);
}
}
OUTPUT:----->
C:\>tracert -d 5 -w 600 www.yahoo.com
Tracing route to www.yahoo.akadns.net [68.142.226.39]
over a maximum of 30 hops:
1 <10 ms <10 ms <10 ms 10.129.210.100
2 * * * Request timed out.
3 * * * Request timed out.
4 * * * Request timed out.
5 * * * Request timed out.
6 * * * Request timed out.
7 * * * Request timed out.
8 * * * Request timed out.
9 * * * Request timed out.
10 * * * Request timed out.
plz help
Thanks
![]() |
Similar Threads
- network programming using winsocket (VB.NET)
- Network Programming - send/recv and Timeout Query (C++)
- Help! my DNS server is slowing my network down (Networking Hardware Configuration)
- VB.NET Network Programming (VB.NET)
- Help required for Sun Certified Java Developer Exam(SCJD) (Java)
- java books (Java)
- network programming using winsocket (VB.NET)
- network programming (VB.NET)
- Peer-to-peer network programming tutorials, know of any? (C)
Other Threads in the Java Forum
- Previous Thread: DNS: RouteThrough , " RT" in java networking programming
- Next Thread: Conditional Expression in JAVA
| Thread Tools | Search this Thread |
911 actionlistener addball addressbook android api applet application array automation binary block bluetooth button character class client code component consumer css csv database desktop developmenthelp eclipse ee error fractal ftp game gameprogramming givemetehcodez graphics gui html ide image j2me j2seprojects japplet java javaarraylist javac javaee javaprojects jni jpanel julia jvm lego linked linux loan mac map method mobile netbeans notdisplaying number objects online oriented phone printf problem program programming project projects recursion replaydirector reporting researchinmotion rotatetext rsa scanner se server service set singleton sms software sort sql swing system test textfields threads time title tree tutorial-sample ubuntu update windows working





