Skip to main content

OXL DNSBL Checker

Project description

DNSBL Checker

Lint Test

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] [-s SKIP_PROVIDERS] [--details]

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
  -s SKIP_PROVIDERS, --skip-providers SKIP_PROVIDERS
                        Comma-separated list of base-providers to skip
  --details             If the result 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"
>   ],
>   "general_errors": [],
>   "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'], 'general_errors': [], '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', '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', '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/2)>

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 (:

See: Contribute

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

dnsbl_check-2.0.1.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dnsbl_check-2.0.1-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file dnsbl_check-2.0.1.tar.gz.

File metadata

  • Download URL: dnsbl_check-2.0.1.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for dnsbl_check-2.0.1.tar.gz
Algorithm Hash digest
SHA256 52a27f91394b5c310f384b32418d073eeb51e448a7577a227c56aa5bef12d532
MD5 1e120384f04774eeb4bbefbec09f6bdb
BLAKE2b-256 2a0dc6392fa56a9a70c5c9df8b7f86d96b5204717c57155da2229ee150db85fb

See more details on using hashes here.

File details

Details for the file dnsbl_check-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: dnsbl_check-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for dnsbl_check-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ec569213eb38623f3689145d04382daf70128bb1236c3e5473ba43d4cbdd2e08
MD5 6eb5d94b134cc329b7091f0f43c3f908
BLAKE2b-256 80831625fed7e23a67bf7be65fd2956a224eeab5c9221e940eacf99d9b5b1b06

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