Awesome Open Source
Awesome Open Source


Async dnsbl lists checker based on asyncio/aiodns. Checks if ip is listed in anti-spam dns blacklists. Multiple dns blacklists supported. Use aiodns for async dns requests. Usually ip check run for 50+ lists takes less than one second. Also allow to check domains.


pip install pydnsbl


  • python >= 3.5
  • aiodns


Check ip

>>> import pydnsbl
>>> ip_checker = pydnsbl.DNSBLIpChecker()
>>> ip_checker.check('')
<DNSBLResult:  (0/52)>
>>> ip_checker.check('')
<DNSBLResult: [BLACKLISTED] (6/52)>

Check domain

>>> import pydnsbl
>>> domain_checker = pydnsbl.DNSBLDomainChecker()
>>> domain_checker.check('')
<DNSBLResult:  (0/4)>
>>> domain_checker.check('')
<DNSBLResult: [BLACKLISTED] (2/4)>

DNSBLResult properties

  • DNSBLResult.addr - ip address or domain that was checked
  • DNSBLResult.blacklisted - boolean, True if ip/domain detected by at least one provider
  • DNSBLResult.detected_by - dictionary containing providers hosts detected this ip/domain as keys and their category verdicts
  • DNSBLResult.categories - combined categories from all providers for this ip/domain
  • DNSBLResult.providers - list of providers that was performing the check
  • DNSBLResult.failed_providers - list of providers that was unable to check this ip properly (possibly provider was down)
>>> result = domain_checker.check('')
>>> result.addr
>>> result.blacklisted
>>> result.detected_by
{'': ['unknown'], '': ['spam']}
>>> result.categories
{'unknown', 'spam'}
>>> result.providers
[<Provider:>, <Provider:>, <Provider: >, <Provider:>]
>>> result.failed_providers

Extending/overriding providers


from pydnsbl import DNSBLIpChecker, providers
from pydnsbl.providers import BASE_PROVIDERS, Provider
providers = BASE_PROVIDERS + [Provider(''), ...]
checker = DNSBLIpChecker(providers=providers)


Take a look into file.

  • Use Provider class to create your custom providers.
  • Override process_response method of Provider class to map providers response codes (127.0.0.x) to DNSBL categories.


Feel free to contact me: ippolitov87 at

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
python (53,372
async (485
mail (104
blacklist (39
spam (29