diff --git a/app/lib/dns_lookup.rb b/app/lib/dns_lookup.rb index 983f288..74f454c 100644 --- a/app/lib/dns_lookup.rb +++ b/app/lib/dns_lookup.rb @@ -13,7 +13,6 @@ def run(domain, type) domain = "#{domain.split('.').reverse.join('.')}.in-addr.arpa" end response = resolver.query(domain, type) - @duration = (Time.monotonic_now - start_time) * 1000 { json: { @@ -33,6 +32,8 @@ def run(domain, type) { json: { status: 'NOTIMP', from: @server }, zone: e.response.to_s } rescue Dnsruby::OtherResolvError { json: { status: 'OTHER ERROR', from: @server } } + ensure + @duration = (Time.monotonic_now - start_time) * 1000 end private