Upon further investigation, it appears that the DNS resolution on the absolut Apache server is not working consistently. Here's another test script show that 2 out of 10 times, the server failed to return a valid IP address when gethostbyname was called from a PHP script.
Here's the script:
Code:
<?php
/*
* http://belltown.x10hosting.com/test.php
*/
$host = 'maps.google.com';
echo "Looking up: $host<br><br>";
for ($i = 0; $i < 10; $i++) {
$ip = gethostbyname($host);
if ($ip == $host) {
echo "Unable to resolve host name<br>";
}
else {
echo "IP address: $ip<br>";
}
sleep (5);
}
?>
And here's the output:
Code:
Looking up: maps.google.com
IP address: 74.125.95.104
IP address: 74.125.95.147
IP address: 74.125.95.103
Unable to resolve host name
IP address: 74.125.95.105
Unable to resolve host name
IP address: 74.125.95.99
IP address: 74.125.95.147
IP address: 74.125.95.105
IP address: 74.125.95.106