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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pydnsbl-0.5.2.tar.gz.
File metadata
- Download URL: pydnsbl-0.5.2.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1dae1dc7989b846f6d1a537ab82ce2d5a4e27d4d0888a5c851323fb75b6c26a1
|
|
| MD5 |
587a0f9bb93912225bf2aedb00555ba3
|
|
| BLAKE2b-256 |
9990ddc1e071fe5f6829d15022e7dd49e3d6e2e0277255c91aaaf2e1050d82db
|
File details
Details for the file pydnsbl-0.5.2-py3-none-any.whl.
File metadata
- Download URL: pydnsbl-0.5.2-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebfbc3fd0743e53f64b71b2917f5c95dc6cf91daa93a064857241663d65359dc
|
|
| MD5 |
4af22fbdbc2bb07baf4f74107b87c0d0
|
|
| BLAKE2b-256 |
85c398df0ea5e61b87a5e5f5cfe51c568ab3cb2abc67f3058134c86ca41eaa4e
|