Bug #53092 [Opn]: dns_get_record does not return false on dns server failure

From: Date: Mon, 18 Oct 2010 03:37:48 +0000
Subject: Bug #53092 [Opn]: dns_get_record does not return false on dns server failure
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-155282@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=53092&edit=1 ID: 53092 User updated by: gunni at wave dot is Reported by: gunni at wave dot is Summary: dns_get_record does not return false on dns server failure Status: Open Type: Bug Package: Unknown/Other Function Operating System: Ubuntu Server 10.04 PHP Version: 5.3.3 Block user comment: N New Comment: i should clarify: Requests for existing domain names when dns works: OK (array with stuff) Requests for unexisting domain names when dns works: OK (empty array) Requests for existing domain names when dns works: FAIL (empty array) Requests for unexisting domain names when dns works: FAIL (empty array) Previous Comments: ------------------------------------------------------------------------ [2010-10-18 05:30:33] gunni at wave dot is Description: ------------ dns_get_record does not return false on dns server failure If you make an example dns failure by changing resolv.conf to some silly ip (i used 1.3.3.7) Requests for existing domain names: OK (array with stuff) Requests for unexisting domain names: OK (empty array) Requests for any domain when dns server does not respond: FAIL (empty array) Which makes it impossible to see if the dns server failed or if the domain doesn't exist. Documentation states: "This function returns an array of associative arrays, or FALSE on failure." When the DNS server fails, that's considered a failure, correct? Test script: --------------- <?php // try various domains with dns working/not working print_r(dns_get_record('google.com', DNS_A)); ?> Expected result: ---------------- if dns does not respond within timeout, return false. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=53092&edit=1

« previous php.bugs (#155282) next »