diff --git a/Net/DNS2/Resolver.php b/Net/DNS2/Resolver.php index 33497a3..9c75ee4 100644 --- a/Net/DNS2/Resolver.php +++ b/Net/DNS2/Resolver.php @@ -229,9 +229,9 @@ public function query($name, $type = 'A', $class = 'IN') // foreach ($response->answer as $index => $object) { - if ( (strcasecmp($object->name, $name) == 0) - && ($object->type == $type) - && ($object->class == $class) + if ( (strcasecmp(trim($object->name, '.'), trim($packet->question[0]->qname, '.')) == 0) + && ($object->type == $packet->question[0]->qtype) + && ($object->class == $packet->question[0]->qclass) ) { $found = true; break; diff --git a/package.php b/package.php index d3baa49..df66e90 100644 --- a/package.php +++ b/package.php @@ -37,6 +37,7 @@ $pkg->setReleaseStability('stable'); $pkg->setAPIStability('stable'); $pkg->setNotes( +"- fixed an issue when looking up . or com., when using the strict_query_mode flag.\n" . "- fixed a bug in the caching logic where I was loading the content more than once per instance, when really I only need to do it once.\n" . "- changed the Net_DNS2::sock array to use the SOCK_DGRAM and SOCK_STREAM defines, rather than the strings 'tcp' or 'udp'.\n" . "- fixed a bug in the Net_DNS2_Header and Net_DNS2_Question classes, where I was using the wrong bit-shift operators when parsing some of the values. This only became apparent when somebody was trying to use the CAA class (id 257); it was causing this to roll over to the next 8 bit value, and returning 1 (RR A) instead of the CAA class.\n" .