summaryrefslogtreecommitdiff
path: root/dns
diff options
context:
space:
mode:
Diffstat (limited to 'dns')
-rw-r--r--dns/resolver.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/dns/resolver.py b/dns/resolver.py
index f7e8b7a..08e86a2 100644
--- a/dns/resolver.py
+++ b/dns/resolver.py
@@ -433,6 +433,9 @@ class Resolver(object):
@type flags: int
@ivar cache: The cache to use. The default is None.
@type cache: dns.resolver.Cache object
+ @ivar retry_servfail: should we retry a nameserver if it says SERVFAIL?
+ The default is 'false'.
+ @type retry_servfail: bool
"""
def __init__(self, filename='/etc/resolv.conf', configure=True):
"""Initialize a resolver instance.
@@ -473,6 +476,7 @@ class Resolver(object):
self.payload = 0
self.cache = None
self.flags = None
+ self.retry_servfail = False
def read_resolv_conf(self, f):
"""Process f as a file in the /etc/resolv.conf format. If f is
@@ -843,7 +847,7 @@ class Resolver(object):
# rcode in it. Remove the server from the mix if
# the rcode isn't SERVFAIL.
#
- if rcode != dns.rcode.SERVFAIL:
+ if rcode != dns.rcode.SERVFAIL or not retry_servfail:
nameservers.remove(nameserver)
response = None
if not response is None: