put a 4-second lifetime timeout on dns requests

This commit is contained in:
jesopo 2019-07-16 16:58:40 +01:00
parent 1106b5842c
commit bdc4164e05

View file

@ -49,7 +49,8 @@ class Module(ModuleManager.BaseModule):
for record_type in record_types:
try:
record_type_strip = record_type.rstrip("?")
query_result = resolver.query(hostname, record_type_strip)
query_result = resolver.query(hostname, record_type_strip,
lifetime=4)
query_results = [q.to_text() for q in query_result]
results.append([record_type_strip, query_results])
except dns.resolver.NXDOMAIN: