Bug #53092 [Opn]: dns_get_record does not return false on dns server failure
| From: | datibbaw@php.net | Date: | Tue, 15 Jul 2014 12:42:09 +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-186634@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=53092&edit=1
ID: 53092
Updated by: datibbaw@php.net
Reported by: gunni at wave dot is
Summary: dns_get_record does not return false on dns server
failure
Status: Open
Type: Bug
Package: Network related
Operating System: Ubuntu Server 10.04
PHP Version: 5.3.3
Block user comment: N
Private report: N
New Comment:
With the PR applied and setting the name server to ::1, it produces the following warning:
Warning: dns_get_record(): A temporary server error occurred.
Previous Comments:
------------------------------------------------------------------------
[2011-03-05 09:50:54] error at ioerror dot us
It should be noted that this general issue also affects gethostbyname() and its friends; PHP
provides no way to distinguish between NXDOMAIN and SERVFAIL. I have a feature which must
distinguish between them to work properly, and so I can't roll it out.
------------------------------------------------------------------------
[2010-10-18 06:30:03] gunni at wave dot is
i fail hard
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 DOES NOT work: FAIL (empty array)
Requests for unexisting domain names when dns DOES NOT work: FAIL (empty array)
------------------------------------------------------------------------
[2010-10-18 05:37:48] gunni at wave dot is
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)
------------------------------------------------------------------------
[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 https://bugs.php.net/bug.php?id=53092&edit=1