From e54dc198542c7d2c3cefda3ff40bb09a51da40bc Mon Sep 17 00:00:00 2001 From: KiekerJan Date: Tue, 21 Sep 2021 22:17:10 +0200 Subject: [PATCH] slightly change dns resolver call --- management/status_checks.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/management/status_checks.py b/management/status_checks.py index 531a63d9..33641ed2 100755 --- a/management/status_checks.py +++ b/management/status_checks.py @@ -73,6 +73,9 @@ def get_ssh_port(): except FileNotFoundError: # sshd is not installed. That's ok. return None + except subprocess.CalledProcessError: + # error while calling shell command + return None returnNext = False for e in output.split(): @@ -799,7 +802,7 @@ def query_dns(qname, rtype, nxdomain='[Not Set]', at=None, as_list=False): # Do the query. try: - response = resolver.resolve(qname, rtype) + response = resolver.resolve(qname, rtype, search=True) except (dns.resolver.NoNameservers, dns.resolver.NXDOMAIN, dns.resolver.NoAnswer): # Host did not have an answer for this query; not sure what the # difference is between the two exceptions.