update dnspython lib, use new .resolve
This commit is contained in:
parent
6d99a9fae6
commit
68939b7ee0
3 changed files with 4 additions and 4 deletions
|
@ -52,12 +52,12 @@ class Module(ModuleManager.BaseModule):
|
||||||
def _check_list(self, list, address):
|
def _check_list(self, list, address):
|
||||||
list_address = "%s.%s" % (address, list)
|
list_address = "%s.%s" % (address, list)
|
||||||
try:
|
try:
|
||||||
a_record = dns.resolver.query(list_address, "A")[0].to_text()
|
a_record = dns.resolver.resolve(list_address, "A")[0].to_text()
|
||||||
except dns.resolver.NXDOMAIN:
|
except dns.resolver.NXDOMAIN:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
txt_record = dns.resolver.query(list_address, "TXT")[0].to_text()
|
txt_record = dns.resolver.resolve(list_address, "TXT")[0].to_text()
|
||||||
except:
|
except:
|
||||||
txt_record = None
|
txt_record = None
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ class Module(ModuleManager.BaseModule):
|
||||||
for record_type in record_types:
|
for record_type in record_types:
|
||||||
record_type_strip = record_type.rstrip("?").upper()
|
record_type_strip = record_type.rstrip("?").upper()
|
||||||
try:
|
try:
|
||||||
query_result = resolver.query(hostname, record_type_strip,
|
query_result = resolver.resolve(hostname, record_type_strip,
|
||||||
lifetime=4)
|
lifetime=4)
|
||||||
query_results = [q.to_text() for q in query_result]
|
query_results = [q.to_text() for q in query_result]
|
||||||
results.append([record_type_strip, query_result.rrset.ttl,
|
results.append([record_type_strip, query_result.rrset.ttl,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
beautifulsoup4 ==4.8.0
|
beautifulsoup4 ==4.8.0
|
||||||
cryptography ==2.7
|
cryptography ==2.7
|
||||||
dataclasses ==0.6;python_version<'3.7'
|
dataclasses ==0.6;python_version<'3.7'
|
||||||
dnspython ==1.16.0
|
dnspython ==2.0.0
|
||||||
feedparser ==5.2.1
|
feedparser ==5.2.1
|
||||||
html5lib ==1.0.1
|
html5lib ==1.0.1
|
||||||
isodate ==0.6.0
|
isodate ==0.6.0
|
||||||
|
|
Loading…
Reference in a new issue