Skip to content

Commit

Permalink
Two bugfixes for the DNSRecordGetterDirect class. (#23)
Browse files Browse the repository at this point in the history
First one: it is not properly using TCP when asked to do so. The reason is that it is not passing $this->udp to the DNSQuery.

Second: resolvePtr method is using the SPL implementation of dns_get_record instead of using the class' implementation.
  • Loading branch information
hluaces authored and Mika56 committed Oct 31, 2017
1 parent 744a81b commit d427160
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DNSRecordGetterDirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function resolvePtr($ipAddress)

$revs = array_map(function ($e) {
return $e['target'];
}, dns_get_record($revIp, "PTR"));
}, $this->dns_get_record($revIp, "PTR"));

return array_slice($revs, 0, 10);
}
Expand Down Expand Up @@ -169,7 +169,7 @@ public function dns_get_record($question, $type)

$response = array();

$dnsquery = new DNSQuery($this->nameserver, (int)$this->port, (int)$this->timeout, true, false, false);
$dnsquery = new DNSQuery($this->nameserver, (int)$this->port, (int)$this->timeout, $this->udp, false, false);

$result = $dnsquery->query($question, $type);

Expand Down

0 comments on commit d427160

Please sign in to comment.