Skip to content

Commit

Permalink
Merge pull request #19800 from zeroSteiner/fix/dns/caching-incompatib…
Browse files Browse the repository at this point in the history
…le-answers

Carry on if the record can't be cached
  • Loading branch information
adfoster-r7 authored Jan 15, 2025
2 parents 6a4844b + e425bba commit 9c98804
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/rex/proto/dns/cached_resolver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ def send(argument, type = Dnsruby::Types::A, cls = Dnsruby::Classes::IN)
resolved = super(resolve, type)
req.instance_variable_set(:@answer, (req.answer + resolved.answer).uniq)
resolved.answer.each do |ans|
self.cache.cache_record(ans)
begin
self.cache.cache_record(ans)
rescue StandardError => e
elog('Failed to cache the DNS answer', error: e)
end
end
end
# Finalize answers in response
Expand Down

0 comments on commit 9c98804

Please sign in to comment.