Fix manual QA edge case

This commit is contained in:
Matej Bačo 2025-08-06 11:30:56 +02:00
parent 10a7f8acfe
commit 3541fcb237

View file

@ -66,7 +66,14 @@ class DNS extends Validator
$dns = new Client($this->dnsServer);
try {
$query = $dns->query($value, $this->type);
$rawQuery = $dns->query($value, $this->type);
// Some DNS servers return all records, not only type that's asked for
// Likely occurs when no records of specific type are found
$query = array_filter($rawQuery, function ($record) {
return $record->getTypeName() === $this->type;
});
$this->logs = $query;
} catch (\Exception $e) {
$this->logs = ['error' => $e->getMessage()];