Announcement

Collapse
No announcement yet.

Trace DNS Script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • express
    replied
    Yes ping works ok.

    Leave a comment:


  • Mark Hensler
    replied
    I've noticed that about traceroute too.

    Does your ping work? (mine is)

    Leave a comment:


  • express
    replied
    We have it working we had to chmod 4755 /usr/sbin/traceroute
    We removed the traceroute part though from script because it took way to long on some ip's and domain names, We left ping though.

    Leave a comment:


  • express
    replied
    Thanks that worked great, Here is what I have left
    Ping Results:

    Ping failed. Host may not be active.

    Traceroute Results:

    Traceroute failed. Host may not be active.

    By the way from shell traceroute works
    here is how it looks in a shell output

    [email protected] [~]# /usr/sbin/traceroute realwebhost.net
    traceroute to realwebhost.net (64.71.176.104), 30 hops max, 38 byte packets
    1 64.71.176.104 (64.71.176.104) 1.054 ms 1.084 ms 0.886 ms
    Last edited by express; Fri 5 Apr '02, 12:41am.

    Leave a comment:


  • Mark Hensler
    replied
    hacked it a little...

    I've never used `dig` before (I actually had to install it just now).
    I hope I didn't remove anything vital.
    I just tried to remove the DiG headers and commented lines like noted in his TODO.
    PHP Code:
    function dig($target){
        global 
    $ntarget;
        
    message("<p><b>DNS Query Results:</b><blockquote>");
        
    #$target = gethostbyaddr($target);
        #if (! eregi("[a-zA-Z]", ($target = gethostbyaddr($target))) )
        
    if( (!eregi("[a-zA-Z]"$target) && (!eregi("[a-zA-Z]"$ntarget))))
        
    $msg .= "Can't do a DNS query without a hostname.";
        else{
            if(!
    eregi("[a-zA-Z]"$target)) $target $ntarget;
            
    //  if (! $msg .= trim(nl2br(`dig any '$target'`))) #bugfix
            
    if (! $msg .= '<pre>' . `dig any '$target' | awk '{if (NR>6) print $0}' | sed -e 's/^;; //g' -e 's/^;//g'` . '</pre>'#bugfix
            
    $msg .= "The <i>dig</i> command is not working on your system.";
        }
        echo 
    $msg$msg=NULL;
        
    #TODO: Clean up output, remove ;;'s and DiG headers
        
    $msg .= "</blockquote></p>";
        
    message($msg);

    sample output:
    Code:
    QUESTION SECTION:
    yahoo.com.			IN	ANY
    
    ANSWER SECTION:
    yahoo.com.		113815	IN	NS	ns1.yahoo.com.
    yahoo.com.		113815	IN	NS	ns2.yahoo.com.
    yahoo.com.		113815	IN	NS	ns3.yahoo.com.
    yahoo.com.		113815	IN	NS	ns4.yahoo.com.
    yahoo.com.		113815	IN	NS	ns5.yahoo.com.
    yahoo.com.		300	IN	MX	1 mx1.mail.yahoo.com.
    yahoo.com.		300	IN	MX	1 mx2.mail.yahoo.com.
    yahoo.com.		300	IN	MX	5 mx4.mail.yahoo.com.
    yahoo.com.		869	IN	A	66.218.71.113
    yahoo.com.		869	IN	A	66.218.71.112
    yahoo.com.		76	IN	SOA	hidden-master.yahoo.com. hostmaster.yahoo-inc.com. 2002040447 900 300 604800 600
    
    AUTHORITY SECTION:
    yahoo.com.		113815	IN	NS	ns1.yahoo.com.
    yahoo.com.		113815	IN	NS	ns2.yahoo.com.
    yahoo.com.		113815	IN	NS	ns3.yahoo.com.
    yahoo.com.		113815	IN	NS	ns4.yahoo.com.
    yahoo.com.		113815	IN	NS	ns5.yahoo.com.
    
    ADDITIONAL SECTION:
    ns1.yahoo.com.		154968	IN	A	66.218.71.63
    ns2.yahoo.com.		154968	IN	A	209.132.1.28
    ns3.yahoo.com.		154968	IN	A	217.12.4.104
    ns4.yahoo.com.		154968	IN	A	63.250.206.138
    ns5.yahoo.com.		113750	IN	A	64.58.77.85
    mx1.mail.yahoo.com.	1106	IN	A	64.157.4.85
    mx1.mail.yahoo.com.	1106	IN	A	64.157.4.89
    mx1.mail.yahoo.com.	1106	IN	A	64.157.4.81
    
    Query time: 62 msec
    SERVER: 68.6.16.30#53(68.6.16.30)
    WHEN: Fri Apr  5 07:53:16 2002
    MSG SIZE  rcvd: 483

    Leave a comment:


  • Mark Hensler
    replied
    Oh boy, a new toy!

    Leave a comment:


  • express
    replied
    Ok all works except these 2, Eva do you have a problem with these also?

    Ping Results:

    Ping failed. Host may not be active.

    Traceroute Results:

    Traceroute failed. Host may not be active.

    Leave a comment:


  • express
    replied
    Will try it Eva, Thanks Much

    Leave a comment:


  • George L
    replied
    network query tool 1.2

    http://shat.net/php/nqt/

    3/1/2002: PHP 4.12 changed the behavior of the gethostbyaddr() function, which broke some parts of the script. Everything should be fixed now ...

    Leave a comment:


  • express
    replied
    Yes same here, trying to figure out is wrong on domain name end.

    Leave a comment:


  • George L
    replied
    i use the same script.. what you need to do is download the latest version which fixes a problem with 4.1.2

    Leave a comment:


  • Mark Hensler
    replied
    It works with my IP, but not my domain name.

    Leave a comment:


  • express
    started a topic Trace DNS Script

    Trace DNS Script

    Having problems with script found here only parts of it do not work.
    Get these 2 errors. Any help would be appreciated.
    Last edited by express; Mon 9 Feb '09, 5:19am.
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X