Home Tutoriais Desenvolvimento PHP – Resolvendo IP para hostname


Este script serve para mostrar o hostname de um IP definido.

<?
print"
<title>Resolve IP to Hostname</title>
<br>
<center>Resolve IP to Hostname</a></center></font>
<form method='post' action='?act=resolve'>
<br>
<center>IP: <input type=text name=ip></input></center></pre>
<center><input type=submit value='Resolve'></input></center>
</form>";
if($_GET['act'] == "resolve"){
$iptoresolve $_POST['ip'];
$hostname gethostbyaddr($iptoresolve);
print"<br><br><br><center>";
print"<b>IP: $iptoresolve </b><br>";
print"<b>HOSTNAME: $hostname </b><br>";
print"</center>";
}
?>

Fonte: http://www.vivaolinux.com.br/script/Resolvendo-IP-para-Hostname-em-PHP

   

Leave a Reply

This blog is kept spam free by WP-SpamFree.