PHP obtiene IP por dominio

<?php
$ip = gethostbyname('www.example.com');

echo $ip;
?>
Nasty Newt