Always add the root . at the end or your server can add it's own suffix.
example: abc.com could become abc.com.yourcompany.com if you don't use abc.com.
I also find this function a litle bit limited because it doesn't tell you if the resolve failed.
TO adress all those issues I use :
function host2ip($host)
{
$host=trim($host.'.'); // clean and add root .
$ip= gethostbyname($host);
if($ip==$host) $ip='';// empty IP if there is no ip
return $ip;
}