Exemple #1
0
}
echo "<input type=checkbox name=binarydebug value=1" . $s . "> show binary,";
if ($extendanswer) {
    $s = " checked";
} else {
    $s = "";
}
echo "<input type=checkbox name=extendanswer value=1" . $s . "> show detail<br>";
echo "<input type=submit value=\"Perform DNS Query\"><br>";
// ** HERE IS THE QUERY SECTION ** //
if (isset($_REQUEST['doquery'])) {
    echo "<pre>";
    $query = new DNSQuery($server, $port, $timeout, $udp, $debug, $binarydebug);
    if ($type == "SMARTA") {
        echo "Smart A Lookup for " . $question . "\n\n";
        $hostname = $query->smartALookup($question);
        echo "Result: " . $hostname . "\n\n";
        echo "</pre>";
        exit;
    }
    echo "Querying: " . $question . " -t " . $type . " @" . $server . "\n";
    $result = $query->query($question, $type);
    if ($query->hasError()) {
        echo "\nQuery Error: " . $query->getLasterror() . "\n\n";
        exit;
    }
    echo "Returned " . count($result) . " Answers\n\n";
    ShowSection($result);
    if ($extendanswer) {
        echo "\nNameserver Records: " . count($query->getLastnameservers()) . "\n";
        ShowSection($query->getLastnameservers());