Async DNSBL lists checker
Project description
aiodnsbl
DNSBL lists checker based on aiodns. Checks if an IP or a domain is listed on anti-spam DNS blacklists.
Notes
This is a fork of pydnsbl.
Key differences:
- Fully type annotated
- No sync wrapper (async only)
- No category classification
Installation
pip install aiodnsbl
Usage
import asyncio
from aiodnsbl import DNSBLChecker
loop = asyncio.get_event_loop()
checker = DNSBLChecker()
# Check IP
loop.run_until_complete(checker.check("8.8.8.8"))
# <DNSBLResult: 8.8.8.8 (0/10)>
loop.run_until_complete(checker.check("68.128.212.240"))
# <DNSBLResult: 68.128.212.240 [BLACKLISTED] (4/10)>
# Check domain
loop.run_until_complete(checker.check("example.com"))
# <DNSBLResult: example.com (0/4)>
# Bulk check
loop.run_until_complete(
checker.bulk_check(["example.com", "8.8.8.8", "68.128.212.240"])
)
# [<DNSBLResult: example.com (0/4)>, <DNSBLResult: 8.8.8.8 (0/10)>, <DNSBLResult: 68.128.212.240 [BLACKLISTED] (4/10)>]
import asyncio
from aiodnsbl import DNSBLChecker
async def main():
checker = DNSBLChecker()
res = await checker.check("68.128.212.240")
print(res)
# <DNSBLResult: 68.128.212.240 [BLACKLISTED] (4/10)>
print(res.blacklisted)
# True
print([provider.host for provider in res.providers])
# ['b.barracudacentral.org', 'bl.spamcop.net', 'dnsbl.sorbs.net', 'ips.backscatterer.org', ...]
print([provider.host for provider in res.detected_by])
# ['b.barracudacentral.org', 'dnsbl.sorbs.net', 'spam.dnsbl.sorbs.net', 'zen.spamhaus.org']
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
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
aiodnsbl-0.1.1.tar.gz
(5.1 kB
view details)
Built Distribution
File details
Details for the file aiodnsbl-0.1.1.tar.gz
.
File metadata
- Download URL: aiodnsbl-0.1.1.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.8 CPython/3.9.7 Darwin/20.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36ff2a7b21db69b7da75ead59fa136390cfd3a7723c646e54cb2ae5bc401e6ca |
|
MD5 | f7d1e724156ab1eb7d9e8a50c1e55ac9 |
|
BLAKE2b-256 | 5cdb4f1cfd6f3d9708fe090c14f5ba09b86ac5b2bca2421cf2ea5600d8cea60b |
Provenance
File details
Details for the file aiodnsbl-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: aiodnsbl-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.8 CPython/3.9.7 Darwin/20.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4736ea32607197b6b3e941f0206dfb661cec51605f268d20640a5c85bd86bc83 |
|
MD5 | b82395c82fef50f29280dfdd78c6f24a |
|
BLAKE2b-256 | 4a0ce62fb5fec5682e2b8cacd1e7338b5893768872f98993c493fe97f9facfe8 |