Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eugenehp/dnsbl
Query DNS-based blackhole lists
https://github.com/eugenehp/dnsbl
Last synced: about 2 months ago
JSON representation
Query DNS-based blackhole lists
- Host: GitHub
- URL: https://github.com/eugenehp/dnsbl
- Owner: eugenehp
- License: mit
- Created: 2021-10-22T15:45:56.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-10-22T20:19:40.000Z (about 3 years ago)
- Last Synced: 2024-09-19T00:55:29.477Z (4 months ago)
- Language: TypeScript
- Homepage:
- Size: 37.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @ehp/dnsbl
Query DNS-based blackhole lists
Support both IPv4 and IPv6 queries. Written in TypeScript. Thanks to @silverwind for the initial version in JavaScript.
Supported by [StartupMail](https://www.startupmail.com)
## Installation
```sh
npm i @ehp/dnsbl
```## Usage
```ts
import dnsbl from '@ehp/dnsbl';await dnsbl.lookup('127.0.0.2', 'zen.spamhaus.org');
// trueawait dnsbl.lookup('127.0.0.2', 'zen.spamhaus.org', {includeTxt: true});
// {
// listed: true,
// txt: [['some txt'], ['another txt']]
// }await dnsbl.batch(['1.2.3.4', '5.6.7.8'], ['dnsbl.somelist.net', 'dnsbl.someotherlist.net']);
// [
// { blacklist: 'dnsbl.somelist.net', address: '1.2.3.4', listed: true },
// { blacklist: 'dnsbl.somelist.net', address: '5.6.7.8', listed: false },
// { blacklist: 'dnsbl.someotherlist.net', address: '1.2.3.4', listed: true },
// { blacklist: 'dnsbl.someotherlist.net', address: '5.6.7.8', listed: false }
// ]
```