diff --git a/docs/exchangelib/autodiscover/discovery.html b/docs/exchangelib/autodiscover/discovery.html
index 9054f269..e7a5801b 100644
--- a/docs/exchangelib/autodiscover/discovery.html
+++ b/docs/exchangelib/autodiscover/discovery.html
@@ -116,8 +116,9 @@
Module exchangelib.autodiscover.discovery
MAX_REDIRECTS = 10 # Maximum number of URL redirects before we give up
DNS_RESOLVER_KWARGS = {}
DNS_RESOLVER_ATTRS = {
- "timeout": AutodiscoverProtocol.TIMEOUT,
+ "timeout": AutodiscoverProtocol.TIMEOUT / 2.5, # Timeout for query to a single nameserver
}
+ DNS_RESOLVER_LIFETIME = AutodiscoverProtocol.TIMEOUT # Total timeout for a query in case of multiple nameservers
def __init__(self, email, credentials=None):
"""
@@ -392,7 +393,7 @@ Module exchangelib.autodiscover.discovery
def _is_valid_hostname(self, hostname):
log.debug("Checking if %s can be looked up in DNS", hostname)
try:
- self.resolver.resolve(f"{hostname}.", "A", lifetime=self.DNS_RESOLVER_ATTRS.get("timeout"))
+ self.resolver.resolve(f"{hostname}.", "A", lifetime=self.DNS_RESOLVER_LIFETIME)
except DNS_LOOKUP_ERRORS as e:
log.debug("DNS A lookup failure: %s", e)
return False
@@ -414,7 +415,7 @@ Module exchangelib.autodiscover.discovery
log.debug("Attempting to get SRV records for %s", hostname)
records = []
try:
- answers = self.resolver.resolve(f"{hostname}.", "SRV", lifetime=self.DNS_RESOLVER_ATTRS.get("timeout"))
+ answers = self.resolver.resolve(f"{hostname}.", "SRV", lifetime=self.DNS_RESOLVER_LIFETIME)
except DNS_LOOKUP_ERRORS as e:
log.debug("DNS SRV lookup failure: %s", e)
return records
@@ -691,8 +692,9 @@
MAX_REDIRECTS = 10 # Maximum number of URL redirects before we give up
DNS_RESOLVER_KWARGS = {}
DNS_RESOLVER_ATTRS = {
- "timeout": AutodiscoverProtocol.TIMEOUT,
+ "timeout": AutodiscoverProtocol.TIMEOUT / 2.5, # Timeout for query to a single nameserver
}
+ DNS_RESOLVER_LIFETIME = AutodiscoverProtocol.TIMEOUT # Total timeout for a query in case of multiple nameservers
def __init__(self, email, credentials=None):
"""
@@ -967,7 +969,7 @@
def _is_valid_hostname(self, hostname):
log.debug("Checking if %s can be looked up in DNS", hostname)
try:
- self.resolver.resolve(f"{hostname}.", "A", lifetime=self.DNS_RESOLVER_ATTRS.get("timeout"))
+ self.resolver.resolve(f"{hostname}.", "A", lifetime=self.DNS_RESOLVER_LIFETIME)
except DNS_LOOKUP_ERRORS as e:
log.debug("DNS A lookup failure: %s", e)
return False
@@ -989,7 +991,7 @@
log.debug("Attempting to get SRV records for %s", hostname)
records = []
try:
- answers = self.resolver.resolve(f"{hostname}.", "SRV", lifetime=self.DNS_RESOLVER_ATTRS.get("timeout"))
+ answers = self.resolver.resolve(f"{hostname}.", "SRV", lifetime=self.DNS_RESOLVER_LIFETIME)
except DNS_LOOKUP_ERRORS as e:
log.debug("DNS SRV lookup failure: %s", e)
return records
@@ -1166,6 +1168,10 @@ Class variables
+var DNS_RESOLVER_LIFETIME
+
+
+
var INITIAL_RETRY_POLICY
@@ -1323,6 +1329,7 @@