diff options
| author | Bob Halley <halley@dnspython.org> | 2014-08-31 16:36:03 -0700 |
|---|---|---|
| committer | Bob Halley <halley@dnspython.org> | 2014-08-31 16:36:03 -0700 |
| commit | d0359473bf0f42e77f0fa29cfafd40fa6070e72b (patch) | |
| tree | fbfc27d7fe4dad380f350a731899ef1d091cd799 | |
| parent | 1966831a7357e804071c332e0ea3cfe0b19fd393 (diff) | |
| download | dnspython-d0359473bf0f42e77f0fa29cfafd40fa6070e72b.tar.gz | |
Tweak options rotate.
| -rw-r--r-- | ChangeLog | 10 | ||||
| -rw-r--r-- | dns/resolver.py | 2 |
2 files changed, 11 insertions, 1 deletions
@@ -1,3 +1,13 @@ +2014-08-31 Bob Halley <halley@dnspython.org> + + * 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 <halley@dnspython.org> * dns/zone.py: Do not put back an unescaped token. This was diff --git a/dns/resolver.py b/dns/resolver.py index 97bd0a8..3d3cccb 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: |
