{"id":15659152,"url":"https://github.com/silverwind/dnsbl","last_synced_at":"2025-04-27T06:51:56.729Z","repository":{"id":21446339,"uuid":"24764697","full_name":"silverwind/dnsbl","owner":"silverwind","description":"Query DNS-based blackhole lists","archived":false,"fork":false,"pushed_at":"2024-04-13T18:57:55.000Z","size":419,"stargazers_count":24,"open_issues_count":4,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-27T06:51:51.143Z","etag":null,"topics":["blackhole","blackhole-lists","dnsbl","javascript","rbl","spam","spam-filtering"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/silverwind.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-10-03T16:04:04.000Z","updated_at":"2024-08-13T07:22:10.000Z","dependencies_parsed_at":"2023-02-14T02:01:43.345Z","dependency_job_id":"dafac9b3-9f51-4113-a9e7-9c4d65edbf61","html_url":"https://github.com/silverwind/dnsbl","commit_stats":{"total_commits":90,"total_committers":4,"mean_commits":22.5,"dds":0.0888888888888889,"last_synced_commit":"3b87ed99f52897d45d807b70f64a656fd01de4f7"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silverwind%2Fdnsbl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silverwind%2Fdnsbl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silverwind%2Fdnsbl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silverwind%2Fdnsbl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/silverwind","download_url":"https://codeload.github.com/silverwind/dnsbl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251099735,"owners_count":21536153,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blackhole","blackhole-lists","dnsbl","javascript","rbl","spam","spam-filtering"],"created_at":"2024-10-03T13:15:24.083Z","updated_at":"2025-04-27T06:51:56.713Z","avatar_url":"https://github.com/silverwind.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dnsbl\n[![](https://img.shields.io/npm/v/dnsbl.svg?style=flat)](https://www.npmjs.org/package/dnsbl) [![](https://img.shields.io/npm/dm/dnsbl.svg)](https://www.npmjs.org/package/dnsbl) [![](https://packagephobia.com/badge?p=dnsbl)](https://packagephobia.com/result?p=dnsbl)\n\u003e Query DNS-based blackhole lists\n\nSupport both IPv4 and IPv6 queries.\n\n## Installation\n```sh\n$ npm i dnsbl\n```\n\n## Usage\n```js\nimport {lookup, batch} from 'dnsbl';\n\nawait lookup('127.0.0.2', 'zen.spamhaus.org');\n// true\n\nawait lookup('127.0.0.2', 'zen.spamhaus.org', {includeTxt: true});\n// {\n//   listed: true,\n//   txt: [['some txt'], ['another txt']]\n// }\n\nawait batch(['1.2.3.4', '5.6.7.8'], ['dnsbl.somelist.net', 'dnsbl.someotherlist.net']);\n// [\n//   { blacklist: 'dnsbl.somelist.net', address: '1.2.3.4', listed: true },\n//   { blacklist: 'dnsbl.somelist.net', address: '5.6.7.8', listed: false },\n//   { blacklist: 'dnsbl.someotherlist.net', address: '1.2.3.4', listed: true },\n//   { blacklist: 'dnsbl.someotherlist.net', address: '5.6.7.8', listed: false }\n// ]\n```\n\n## API\n### lookup(address, blacklist, [options])\n- `address`: *string* an IP address.\n- `blacklist`: *string* the hostname of the blacklist to query.\n\nReturns a `Promise` that resolves to `true` or `false`, indicating if the address is listed (e.g. the DNS query returned a non-empty result). Will reject on error.\n\nIf the `includeTxt` option is set, it will return an `Object` with these properties:\n- `listed` *boolean* - a boolean indicating if the address is listed on the blacklist.\n- `txt` *string[]* - an array of resolved TXT records for the address.\n\n### batch(addresses, blacklists, [options])\n- `addresses` *string* or *Array* - one or more IP addresses.\n- `blacklists` *string* or *Array* - one or more blacklist hostnames.\n\nReturns a `Promise` that resolve to a `results` object (see below).\n\n### `options` object\n- `servers` *string* or *Array* - DNS servers to use. Pass a falsy value to use the system resolvers. Default: `['208.67.220.220', '208.67.222.222', '2620:119:35::35', '2620:119:53::53']`.\n- `timeout` *number* - timout in milliseconds. Default: `5000`.\n- `concurrency` *number* - number of concurrent queries. Default: `64`.\n- `includeTxt` *boolean* - include txt records if IP is blacklisted. Default: `false`.\n\n### `results` object\nThe `results` object is an array of objects with these properies:\n- `address` *string* - the IP address.\n- `blacklist` *string* - the blacklist hostname.\n- `listed` *boolean* - a boolean indicating if the address is listed on the blacklist.\n- `txt` *string[]* - an array of resolved TXT records for the address.\n\n© [silverwind](https://github.com/silverwind), distributed under BSD licence\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilverwind%2Fdnsbl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsilverwind%2Fdnsbl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilverwind%2Fdnsbl/lists"}