From: Bob Halley Date: Sun, 31 Aug 2014 23:36:03 +0000 (-0700) Subject: Tweak options rotate. X-Git-Tag: v1.12.0-py3~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d0359473bf0f42e77f0fa29cfafd40fa6070e72b;p=thirdparty%2Fdnspython.git Tweak options rotate. --- diff --git a/ChangeLog b/ChangeLog index 33702821..f6dbf784 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2014-08-31 Bob Halley + + * The /etc/resolv.conf setting "options rotate" is now understood + by the resolver. If present, the resolver will shuffle the + nameserver list each time dns.resolver.query() is called. Thanks + to underrun for the patch. Note that you don't want to add + "options rotate" to your /etc/resolv.conf if your system's + resolver library does not understand it. In this case, just set + resolver.rotate = True by hand. + 2014-04-11 Bob Halley * dns/zone.py: Do not put back an unescaped token. This was diff --git a/dns/resolver.py b/dns/resolver.py index 97bd0a88..3d3cccbd 100644 --- a/dns/resolver.py +++ b/dns/resolver.py @@ -543,7 +543,7 @@ class Resolver(object): for suffix in tokens[1:]: self.search.append(dns.name.from_text(suffix)) elif tokens[0] == 'options': - if len(tokens) == 2 and tokens[1] == 'rotate': + if 'rotate' in tokens[1:]: self.rotate = True finally: if want_close: