Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yaroslaff/async-dnsbl-client
Asynchronous dnsbl client
https://github.com/yaroslaff/async-dnsbl-client
antispam async asyncio dns dnsbl dnsbl-checker python python3 spam spam-filtering
Last synced: 5 days ago
JSON representation
Asynchronous dnsbl client
- Host: GitHub
- URL: https://github.com/yaroslaff/async-dnsbl-client
- Owner: yaroslaff
- License: mit
- Created: 2022-02-06T15:52:55.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-02-10T14:06:21.000Z (almost 3 years ago)
- Last Synced: 2024-10-12T22:39:29.987Z (about 1 month ago)
- Topics: antispam, async, asyncio, dns, dnsbl, dnsbl-checker, python, python3, spam, spam-filtering
- Language: Python
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# async-dnsbl-client
Asynchronous dnsbl client## Install
~~~
pip3 install async-dnsbl-client
~~~
or
~~~
pip3 install git+https://github.com/yaroslaff/async-dnsbl-client
~~~## CLI usage:
~~~
$ adnsbl.py 117.207.230.178
dnsbl.sorbs.net
dul.dnsbl.sorbs.net
spam.dnsbl.sorbs.net
zen.spamhaus.org
noptr.spamrats.com
b.barracudacentral.org
web.dnsbl.sorbs.net
pbl.spamhaus.org# or with hostname
$ bin/adnsbl.py gmail-smtp-in.l.google.com
~~~you may remove some DNSBL from checklist with `-r`/`--remove`: `-r dnsbl.sorbs.net dul.dnsbl.sorbs.net`, or add new
DNSBL zones same way with `-a`/`--append`.`adnsbl.py` exit code is 0 if host isn't blacklisted anywhere, and 1 otherwise.
## Usage in your python code
See adnsbl.py sources, it's simple.
~~~python
import asyncio
import async_dnsbl_clientresult = asyncio.run(async_dnsbl_client.dnsbl('gmail-smtp-in.l.google.com'))
~~~
## Why not adns?
There is already python3 adns support in [python3-adns](https://github.com/trolldbois/python3-adns) package. But it crashes on ARM machines (such as Raspberri Pi (arch: armv7l) and Oracle Ampere A1 (arch: aarch64)). (maybe you know why?)~~~python3
>>> import adns
>>> adns.init()
Segmentation fault (core dumped)
~~~on 'normal' amd64 it works fine,
async-dnsbl-client works fine on ARM machines (), checking host in 53 blacklists in 0.127s (fastest).
## See also
This project uses [aiodns package](https://github.com/saghul/aiodns)
[pydnsbl](https://github.com/dmippolitov/pydnsbl) - more mature package, looks more powerful, same fast. (But I need my project because sometimes simpler is better)