Home » Networking » Net_DNS » Bug #4025
Net_DNS incompatible with BIND8 as cache
Details
| Submitted | 2005-04-01 14:42 UTC |
|---|---|
| From | cox at idecnet dot com |
| Assigned | coz |
| Status | Closed |
| Package | Net_DNS |
| PHP Version | 4.3.9 |
| OS | n/a |
| Roadmaps | (Not assigned) |
Comments
[2005-04-01 14:42 UTC] cox at idecnet dot com
Description:
------------
Hi,
Using BIND 9.3 as caching name server, Net_DNS always fails with "time out".
The problem is the function Net_DNS_Packet::parse_rr() when called from the Authority section of Net_DNS_Packet::parse() (line 268).
Maybe that could be related: from the dnscache doc (http://cr.yp.to/djbdns/dnscache.html):
"According to RFC 1035, the AA bit ``specifies that the responding name server is an authority for the domain name in question section.'' dnscache is not an authority for any domain names. dnscache never sets the AA bit (except in NXDOMAIN responses, as required by RFC 2308, to work around a common client bug). In contrast, BIND often sets AA for positive responses even when it is not an authority for the domain name. (This appears to have been fixed in BIND 9.)"
Reproduce code:
---------------
Install Bind 9 as caching nameserver (http://vulcanonet.com/soft/dnscachhe). And:
<?php
require_once 'Net/DNS.php';
$dns = new Net_DNS_Resolver;
$dns->query('yahoo.com');
$dns->query('yahoo.com');
echo $dns->errorstring;
?>
[2005-04-01 16:10 UTC] cox at idecnet dot com
The bug is at Net_DNS_Packet::parse_rr()
Original line 542:
if ( !strlen($name)) {
should be:
if ($name === NULL) {
to match the perl code and to actually work.
Tomas V.V.Cox
[2005-04-06 14:05 UTC] cox at idecnet dot com
Fixed in CVS, the bug could being reproduced under BIND8 as caching nameserver.