Simuler la commande ‘dnslockup’

Author:


Download


<?php
// Obtient l''adresse IP correspondant au nom d''hôte
$resultat = gethostbyname("www.yahoo.fr");
echo "IP = $resultat<br/>";
// Obtient le nom d''hôte  correspondant à l''adresse IP
$host = gethostbyaddr("192.0.34.166");
echo "Host = $host<br/>";

// Obtient la liste des adresses IP correspondant au nom d''hôte
$resultat = gethostbynamel("yahoo.fr");
print_r($resultat)."<br/>";

// Obtient le Mail Exchange(MX) associé au nom d''hôte
$resultat = getmxrr("yahoo.fr",$mxhosts);
print_r($resultat)."<br/>";
?>

Leave a Reply

Your email address will not be published. Required fields are marked *


+ 3 = twelve