#43687 [Opn->Fbk]: gethostbyname() can't return a valid ip address.

From: Date: Mon, 28 Jan 2008 23:54:42 +0000
Subject: #43687 [Opn->Fbk]: gethostbyname() can't return a valid ip address.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-121659@lists.php.net to get a copy of this message
ID: 43687 Updated by: tony2001@php.net Reported By: php at xuefeng dot org -Status: Open +Status: Feedback Bug Type: Network related Operating System: Redhat 2.6.9-42.ELsmp #1 SMP i68 PHP Version: 5.2.5 New Comment: Apparently, the second DNS request fails. You can check it out with strace/tcpdump. Previous Comments: ------------------------------------------------------------------------ [2007-12-30 18:31:58] php at xuefeng dot org defined via DNS entry . ------------------------------------------------------------------------ [2007-12-30 16:24:38] iliaa@php.net Is the xxx.xxx.com domain defined via DNS entry or via a local hosts file? ------------------------------------------------------------------------ [2007-12-27 09:29:26] php at xuefeng dot org Description: ------------ When trying to resolv the ip address of a hostname given in /etc/hosts, it's works fine, but does not work when trying to resolv via the DNS server though. btw: those test code works fine with php 5.2.1 Reproduce code: --------------- var_dump(dns_get_record("xxx.xxx.com")); var_dump(fsockopen("xxx.xxx.com", 80, $error, $errstr)); Expected result: ---------------- array(1) { [0]=> array(5) { ["host"]=> string(12) "xxx.xxx.com" ["type"]=> string(1) "A" ["ip"]=> string(13) "192.168.200.6" ["class"]=> string(2) "IN" ["ttl"]=> int(86400) } } resource(20) of type (stream) Actual result: -------------- array(1) { [0]=> array(5) { ["host"]=> string(12) "xxx.xxx.com" ["type"]=> string(1) "A" ["ip"]=> string(13) "192.168.200.6" ["class"]=> string(2) "IN" ["ttl"]=> int(86400) } } <br /> <b>Warning</b>: fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in <b>/opt/wwwroot/qun_inner/modules/club/my_signatures.php</b> on line <b>68</b><br /> <br /> <b>Warning</b>: fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: unable to connect to xxx.xxx.com:80 (Unknown error) in <b>/opt/wwwroot/qun_inner/modules/club/my_signatures.php</b> on line <b>68</b><br /> bool(false) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43687&edit=1

« previous php.bugs (#121659) next »