mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2026-03-13 17:17:23 +01:00
all DNS queries should have a timeout, fixes #591
This commit is contained in:
@@ -594,6 +594,9 @@ def query_dns(qname, rtype, nxdomain='[Not Set]', at=None):
|
||||
resolver = dns.resolver.Resolver()
|
||||
resolver.nameservers = [at]
|
||||
|
||||
# Set a timeout so that a non-responsive server doesn't hold us back.
|
||||
resolver.timeout = 5
|
||||
|
||||
# Do the query.
|
||||
try:
|
||||
response = resolver.query(qname, rtype)
|
||||
|
||||
Reference in New Issue
Block a user