Hi friends,

when ever i run this script

<?php
$fp = fsockopen("yahoo.com", 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
fputs ($fp, "GET / HTTP/1.0\r\nHost:\r\n\r\n");
while (!feof($fp)) {
echo fgets ($fp,128);
}
fclose ($fp);
}
?>

it returns error

Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution (is your IPV6 configuration correct? If this error happens all the time, try reconfiguring PHP using --disable-ipv6 option to configure) in /mnt/windows/dev/soc.php on line 2

Warning: fsockopen(): unable to connect to yahoo.com:80 in /mnt/windows/dev/soc.php on line 2
Resource temporarily unavailable (11)

but the same works fine for localhost.

What may be the problem?

i am running php4.3.2 + apache2 ( with sockets enabled)
on Redhat linux 8

i tried enabling ipv6 but then also same problem.

Also when ever we try

gethostbyname("localhost");
it returns ip - 127.0.0.1
but for all other domains for eg:
gethostbyname("yahoo.com");
it returns yahoo.com itself not ip.

Any extra configuration needed for Linux to use these socket functions?

Please Help

Thanks in advance
Praveen