I used this one
$hosts = gethostbynamel($hostname);
if (is_array($hosts)) {
echo "Host ".$hostname." resolves to:
";
foreach ($hosts as $ip) {
echo "IP: ".$ip."
";
}
} else {
echo "Host ".$hostname." is not tied to any IP.";
}
?>
from here: http://php.net/manual/en/function.gethostbynamel.php