The PHP manual says when a hostname is not found, the function returns the input parameter, (not FALSE). The script runs correctly on the remote servers, but on the local server it is returning the IP of OpenDNS. It is a trivial problem, but I want to get to the bottom of it.
Code: Select all
function gethostip($host)
{ $hostip = gethostbyname($host);
if ($hostip == $host) { $hostip = "no record"; }
echo ("<TR><TD>".$host."</TD><TD>".$hostip."</TD></TR>");
}