1
0
mirror of https://github.com/danog/dns.git synced 2025-01-22 21:41:11 +01:00

Fix BasicResolver::resolve to break redirect loop

Previously we queried domains usually five times (max redirects). It didn't have much impact, because these records were usually cached and immediately returned again, but this resulted in the TTL always being NULL due to cached records being returned.
This commit is contained in:
Niklas Keller 2017-09-12 17:08:38 +02:00
parent dd6e3c294a
commit 1a41089d84

View File

@ -125,6 +125,8 @@ final class BasicResolver implements Resolver {
]);
$records = \array_merge(...$records);
break; // Break redirect loop, otherwise we query the same records 5 times
} catch (MultiReasonException $e) {
foreach ($e->getReasons() as $reason) {
if ($reason instanceof NoRecordException) {