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 for 60+ lists takes less than one second.

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 = BASE_PROVIDERS + ['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.5.3.tar.gz (4.8 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.5.3-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pydnsbl-0.5.3.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pydnsbl-0.5.3.tar.gz
Algorithm Hash digest
SHA256 ba4154ef0cbf7903492d81f3f544da0c343f786f6471f3f965bf5b9261b68b3c
MD5 4dd00ab904b1d6a9e40861b76b606efb
BLAKE2b-256 f73cb65bfad6e2aa8fca84186c35a987db9810873ac5d1d6fa0eb0e183bc1e55

See more details on using hashes here.

File details

Details for the file pydnsbl-0.5.3-py3-none-any.whl.

File metadata

File hashes

Hashes for pydnsbl-0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 818a3408813a2fbb5715ee0d0b0dcf73c5147a3ae2a5c3cd729f23fe3b78be1a
MD5 af75a883cc658a145ea7e292a783aaa2
BLAKE2b-256 83de26d43537b961487c3897dc7ad50ad6900e11388f09c727b9056b75db1dd1

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