Skip to main content

aiodnsbl

PyPI version Python CI Coverage Status

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

Metadata

Release files for aiodnsbl 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aiodnsbl 1.0.0
File Size Uploaded
aiodnsbl-1.0.0.tar.gz 4.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aiodnsbl 1.0.0
File Interpreter ABI Platform
aiodnsbl-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.7 kB

Release files / aiodnsbl-1.0.0.tar.gz

Download URL aiodnsbl-1.0.0.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
549422155d24358497ee3c4c4504d8836eb1d168853d907716fbb15eb70774a6
BLAKE2b-256 checksum
How to use checksums
faa6e6f861a974dbc28894203a8eba9c7a5c9b0f4dc314d84bf1a280131a1ecc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-1041-azure

Release files / aiodnsbl-1.0.0-py3-none-any.whl

Download URL aiodnsbl-1.0.0-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7ff2fb00ba9516cfa375fd9c990197741f0dfcf41ad53d13d637adfdf6aa6ce5
BLAKE2b-256 checksum
How to use checksums
0649171bd119670e6a03fad2563ced90fcece162532dedccd0dc74f364816878
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-1041-azure

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page