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.0.tar.gz
(4.8 kB
view details)
Built Distribution
File details
Details for the file aiodnsbl-0.1.0.tar.gz
.
File metadata
- Download URL: aiodnsbl-0.1.0.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.8 CPython/3.9.6 Darwin/20.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | de96d26edbbfcc694697a1aa11692dde7a22303f707d13c5bb5fe1069e67938e |
|
MD5 | 4a25f591d5b29e09b1eb43abfa6535ec |
|
BLAKE2b-256 | 42570d94f0a4a22085c585319f1fddcd391c4bc3322fbac278fe9215dfa341af |
Provenance
File details
Details for the file aiodnsbl-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: aiodnsbl-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.8 CPython/3.9.6 Darwin/20.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97c0c2339e779d057e3f3ae4c27b3943e2aff500449f8f412dd5a784315d01a9 |
|
MD5 | c0bfa83f0acdbcb14aa50e760e76b054 |
|
BLAKE2b-256 | bb85307695a634a8446890efddb73a571576b647f7c2898613821e38b1cd1c32 |