Skip to main content

Async dnsbl lists checker based on asyncio/aiodns.

Project description

Async dnsbl lists checker based on asyncio/aiodns. Checks if ip is listed in anti-spam dns blacklists. Multiple dns blacklists supported. Use aiodns for async dns requests. Usually ip check run for 60+ lists takes less than one second.

Installation

pip intall pydnsbl

Requirements

python >= 3.5, aiodns

Usage

>>> from pydnsbl import DNSBLChecker
>>> checker = DNSBLChecker()
>>> result = checker.check_ip('8.8.8.8')
>>> result
<DNSBLResult: 8.8.8.8  (0/62)> # google is clean
>>> result = checker.check_ip('68.128.212.240')
>>> result
<DNSBLResult: 68.128.212.240 [BLACKLISTED] (12/62)>  # this is just for example
>>> result.blacklisted
True
# detected_by dnsbl providers and their category tag for this ip
>>> result.detected_by
{'web.dnsbl.sorbs.net': ['unknown'], ...
'zen.spamhaus.org': ['spam', 'exploits']}

Extending/overriding providers

Basic

>>> from pydnsbl import DNSBLChecker, providers
>>> providers = BASE_PROVIDERS + [providers.Provider('yourprovider1.com'), ...]
>>> checker = DNSBLChecker(providers=providers)
# in providers parameter you can pass providers dnsbl host or Provider class object (see Advanced topic below)

Advanced

Take a look into providers.py file.

  • Use Provider class to create your custom providers.

  • Override process_response method of Provider class to map providers response codes (127.0.0.x) to DNSBLChecker categories.

Contact

Feel free to contact me: ippolitov87 at gmail.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydnsbl-0.6.4.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pydnsbl-0.6.4-py2-none-any.whl (7.4 kB view details)

Uploaded Python 2

File details

Details for the file pydnsbl-0.6.4.tar.gz.

File metadata

  • Download URL: pydnsbl-0.6.4.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.3

File hashes

Hashes for pydnsbl-0.6.4.tar.gz
Algorithm Hash digest
SHA256 0a1221ad2089c8cbb53295d5abe141b312888e4a5044da8204f6b44d65eeb18d
MD5 6ef032da9a93bd6b17747d13b215e599
BLAKE2b-256 374f7d12d31d7d7fb1dcd4f0fab8ab56aa0c76a31c52f90d96b09fa3761917be

See more details on using hashes here.

File details

Details for the file pydnsbl-0.6.4-py2-none-any.whl.

File metadata

  • Download URL: pydnsbl-0.6.4-py2-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.3

File hashes

Hashes for pydnsbl-0.6.4-py2-none-any.whl
Algorithm Hash digest
SHA256 5cb8d8fd3ca2df37cc26268c3317efc1c2be72bd281c61d71a5e72b62d875449
MD5 216480e5fad7c81b0d7cff90628d47a7
BLAKE2b-256 7a22845c8df58f013b84577e6a0c0588b4edb5f7b1ecc24f1b0db23cf02561e3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page