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

Specify nameservers directly #18

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
11 changes: 8 additions & 3 deletions pydnsbl/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@

class Provider(object):

def __init__(self, host):
def __init__(self, host, ns=None):
"""
host: the hostname of provider
ns: the nameserver IP to use for direct lookup
"""
self.host = host
self.ns = ns
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As i understand there is no effect of specifying ns for Provider in the scope of this PR?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this was used in other code not included.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still cant figure out how ns affects resolver


def process_response(self, response):
"""
Expand Down Expand Up @@ -138,8 +143,8 @@ class DblSpamhaus(Provider):
'127.0.1.106': {DNSBL_CATEGORY_ABUSED, DNSBL_CATEGORY_LEGIT, DNSBL_CATEGORY_CNC}
}

def __init__(self, host='dbl.spamhaus.org'):
Provider.__init__(self, host=host)
def __init__(self, host='dbl.spamhaus.org', ns=None):
Provider.__init__(self, host=host, ns=ns)

def process_response(self, response):
categories = set()
Expand Down