mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2024-12-25 07:47:05 +00:00
Merge pull request #4 from kiekerjan/check_dns
slightly change dns resolver call
This commit is contained in:
commit
4f3f35a10b
@ -73,6 +73,9 @@ def get_ssh_port():
|
|||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
# sshd is not installed. That's ok.
|
# sshd is not installed. That's ok.
|
||||||
return None
|
return None
|
||||||
|
except subprocess.CalledProcessError:
|
||||||
|
# error while calling shell command
|
||||||
|
return None
|
||||||
|
|
||||||
returnNext = False
|
returnNext = False
|
||||||
for e in output.split():
|
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.
|
# Do the query.
|
||||||
try:
|
try:
|
||||||
response = resolver.resolve(qname, rtype)
|
response = resolver.resolve(qname, rtype, search=True)
|
||||||
except (dns.resolver.NoNameservers, dns.resolver.NXDOMAIN, dns.resolver.NoAnswer):
|
except (dns.resolver.NoNameservers, dns.resolver.NXDOMAIN, dns.resolver.NoAnswer):
|
||||||
# Host did not have an answer for this query; not sure what the
|
# Host did not have an answer for this query; not sure what the
|
||||||
# difference is between the two exceptions.
|
# difference is between the two exceptions.
|
||||||
|
Loading…
Reference in New Issue
Block a user