Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically Rotate DNS Servers #919

Merged
merged 3 commits into from
Dec 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions bbot/core/helpers/dns.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def __init__(self, *args, **kwargs):
dns_queries_per_second = self._parent_helper.config.get("dns_queries_per_second", 100)
self._dns_rate_limiter = RateLimiter(dns_queries_per_second, "DNS")
super().__init__(*args, **kwargs)
self.rotate = True

async def resolve(self, *args, **kwargs):
async with self._dns_rate_limiter:
Expand Down Expand Up @@ -139,6 +140,8 @@ def __init__(self, parent_helper):

# copy the system's current resolvers to a text file for tool use
self.system_resolvers = dns.resolver.Resolver().nameservers
if len(self.system_resolvers) == 1:
log.warning("BBOT performs better with multiple DNS servers. Your system currently only has one.")
self.resolver_file = self.parent_helper.tempfile(self.system_resolvers, pipe=False)

self.filter_bad_ptrs = self.parent_helper.config.get("dns_filter_ptrs", True)
Expand Down