@ehp/dnsbl
TypeScript icon, indicating that this package has built-in type declarations

0.0.14 • Public • Published

@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

Installation

npm i @ehp/dnsbl

Usage

import dnsbl from '@ehp/dnsbl';

await dnsbl.lookup('127.0.0.2', 'zen.spamhaus.org');
// true

await 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 }
// ]

Package Sidebar

Install

npm i @ehp/dnsbl

Weekly Downloads

3

Version

0.0.14

License

MIT

Unpacked Size

29.9 kB

Total Files

16

Last publish

Collaborators

  • eugenehp