domain.". (.*) IN/"; #$f["next_update"][] = 1; $f["ip"][] = "/(.*)IN A (.*)/"; $f["ip"][] = 2; $f["query_time"][] = "/;; Query time: (.*) msec/"; $f["dns_ip"][] = "/;; SERVER: (.*)#/"; $this->format = $f; } function getDig() { if($this->dns) $dns = "@".$this->dns; if($this->type) $type= $this->type; $cmd = "dig $dns '".$this->domain."' $type "; $this->ShRes = shell_exec($cmd); #echo "
".$this->ShRes."

"; } function setFormat() { $analyse = 0; $t = $this->ShRes; foreach($this->format as $k => $v) { preg_match_all($v[0],$t,$o); # if($k=="next_update") $this->print_rf($o); if($v[1]) $at[$k] = $o[$v[1]][0]; else $at[$k] = $o[1][0]; } #exit; $this->FoRes = $at; } function formatTime($s) { $h = floor($s/3600); $s -= $h*3600; $m = floor($s/60); $s -= $m*60; if($h > 0) $text = sprintf("%d h %d min %d sec",$h,$m,$s); elseif($m > 0) $text = sprintf("%d min %d sec",$m,$s); else $text = sprintf("%d sec",$s); return $text; } function print_rf($a) { echo "
";
		print_r($a);
		echo "
"; } function getResult() { $this->getDig(); $this->loadFormat(); $this->setFormat(); return $this->FoRes; } }


Domain:
"; $dig = new DigIt; #$dig->type = "MX"; $dig->domain = "www.othmar-micheli.com"; $dig->dns = "192.168.0.1"; print_r($dig->getResult()); echo "
"; $dig = new DigIt; #$dig->type = "MX"; $dig->domain = "www.hotmail.com"; $dig->dns = "dns.tin.it"; print_r($dig->getResult()); echo "
"; $dig = new DigIt; $dig->type = "MX"; $dig->domain = "karin-micheli.it"; $dig->dns = "192.168.0.1"; print_r($dig->getResult()); echo ""; ?>