Skip to content

Commit

Permalink
Catch the exception and log a message
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroSteiner committed Jan 15, 2025
1 parent db3699a commit e425bba
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) rescue nil
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 e425bba

Please sign in to comment.