OXL DNSBL Checker
Project description
DNSBL Checker
This script/library can check if an IP or Domain is listed on DNS-BL's.
Please be aware that the providers of such public DNSBL mirrors discourage high-volume lookups. Do not abuse their services! You will run into rate-limits.
Features:
- Asynchronous DNS requests
- Multi-provider support
- Ability to add custom providers
- Check for 50+ lists usually takes a few seconds
- Can also check domains
This started as a fork of github.com/dmippolitov/pydnsbl - so thanks to the contributors ❤️
If you are interested in report-based reputation-systems => check out our Risk-DB project.
Installation
pip install dnsbl-check
Usage
Via CLI
dnsbl-check --help
usage: DNS-BL Lookup-Client [-h] (-i IP | -d DOMAIN) [-j JSON] [-p PROVIDERS]
options:
-h, --help show this help message and exit
-i IP, --ip IP IP to check
-d DOMAIN, --domain DOMAIN
Domain to check
-j JSON, --json JSON Only output JSON
-p PROVIDERS, --providers PROVIDERS
If the provider details should be added to the output
Example:
dnsbl-check --ip 134.209.173.54
> Checking IP 134.209.173.54 ..
> {
> "detected": true,
> "detected_by": [
> "all.s5h.net",
> "dnsbl-3.uceprotect.net"
> ],
> "categories": [
> "unknown"
> ],
> "count": {
> "detected": 2,
> "checked": 43,
> "failed": 2
> }
> }
Programmatically
# IPs
from dnsbl_check import CheckIP
with CheckIP() as checker:
result = checker.check('134.209.173.54')
print(result)
# <DNSBLResult: 134.209.173.54 [DETECTED] (2/43)>
print(result.to_dict())
# {'request': '134.209.173.54', 'detected': True, 'detected_by': ['all.s5h.net', 'dnsbl-3.uceprotect.net'], 'categories': ['unknown'], 'count': {'detected': 2, 'checked': 43, 'failed': 2}, 'detected_provider_categories': {'all.s5h.net': ['unknown'], 'dnsbl-3.uceprotect.net': ['unknown']}, 'checked_providers': ['all.s5h.net', 'aspews.ext.sorbs.net', 'b.barracudacentral.org', 'bl.nordspam.com', 'blackholes.five-ten-sg.com', 'blacklist.woody.ch', 'bogons.cymru.com', 'combined.abuse.ch', 'combined.rbl.msrbl.net', 'db.wpbl.info', 'dnsbl-2.uceprotect.net', 'dnsbl-3.uceprotect.net', 'dnsbl.cyberlogic.net', 'dnsbl.sorbs.net', 'drone.abuse.ch', 'images.rbl.msrbl.net', 'ips.backscatterer.org', 'ix.dnsbl.manitu.net', 'korea.services.net', 'matrix.spfbl.net', 'phishing.rbl.msrbl.net', 'proxy.bl.gweep.ca', 'proxy.block.transip.nl', 'psbl.surriel.com', 'rbl.interserver.net', 'relays.bl.gweep.ca', 'relays.bl.kundenserver.de', 'relays.nether.net', 'residential.block.transip.nl', 'singular.ttk.pte.hu', 'spam.dnsbl.sorbs.net', 'spam.rbl.msrbl.net', 'spambot.bls.digibase.ca', 'spamlist.or.kr', 'spamrbl.imp.ch', 'spamsources.fabel.dk', 'ubl.lashback.com', 'virbl.bit.nl', 'virus.rbl.msrbl.net', 'virus.rbl.jp', 'wormrbl.imp.ch', 'z.mailspike.net', 'zen.spamhaus.org'], 'failed_providers': ['ix.dnsbl.manitu.net', 'spamlist.or.kr']}
print(result.to_json())
# ... (to_dict but in pretty json)
# Domains
from dnsbl_check import CheckDomain
with CheckDomain() as checker:
result = checker.check('maleware.com')
print(result)
# <DNSBLResult: maleware.com (0/43)>
Adding custom providers
from dnsbl_check import CheckIP
from dnsbl_check.providers import BASE_PROVIDERS, Provider
p = BASE_PROVIDERS + [Provider('dnsbl.oxl.app')]
with CheckIP(providers=p) as checker:
result = checker.check('134.209.173.54')
print(result)
# <DNSBLResult: 134.209.173.54 [DETECTED] (3/44)>
Contributing
Contributions are welcome (:
If you have ideas on how to improve the project feel free to:
- report Issues
- request Features
- Discuss about the implementation
- or contact us directly: contact+dnsblcheck@oxl.at
- create Pull-Requests for
- improving and/or extending the Unit-Tests
- improving Performance
- fixing bugs
But please do not post any generic AI-slop.. thanks.
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 dnsbl-check-2.0.0.tar.gz.
File metadata
- Download URL: dnsbl-check-2.0.0.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea38434dea9be52ccb573e9c7adcb6375091614c7ba99ec001eddec20bc76d97
|
|
| MD5 |
0dda5766688eec7728d35d7ca4670c5d
|
|
| BLAKE2b-256 |
a8b2f17ec2262660ea0c4d33d9f701b71571ff229e9571ffae94dfee97a75787
|
File details
Details for the file dnsbl_check-2.0.0-py3-none-any.whl.
File metadata
- Download URL: dnsbl_check-2.0.0-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d2202e7dc9079272dffa6f0edd41ef0a27beeaf298f4c45a3941428d50e012a
|
|
| MD5 |
7736c58c9eac55abac0f558405de0c87
|
|
| BLAKE2b-256 |
c00b4c69d4dfa307aa51d955b2b34d766a03ac0cd1abe84b6ac81bfc4b94db16
|