npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

uptimeify-dnsbl

v1.0.2

Published

Helper module to prepare DNSBL queries and parse results.

Downloads

283

Readme

uptimeify-dnsbl

A lightweight, purely functional helper for checking if an IP is blocklisted. We handle the math and the mapping, you handle the network.

What is this?

Checking DNS blocklists (DNSBL/RBL) usually involves three annoying steps:

  1. Reversing the IP address (e.g. 1.2.3.4 -> 4.3.2.1 or the complex IPv6 nibble format).
  2. Knowing which lists to check and what their specific return codes mean.
  3. Making the DNS queries.

uptimeify-dnsbl solves #1 and #2. We give you the exact domains to query and parse the confusing result codes (like 127.0.0.4) into human-readable reasons.

We intentionally do not perform the DNS lookups internally. This allows you to use your preferred DNS resolver, manage timeouts, handle concurrency, and cache results exactly how your app needs it.

Features

  • IPv4 & IPv6 Support: Correctly handles IP reversal for both protocols.
  • Result Parsing: Translates cryptic return codes (127.0.0.2, 127.0.0.10) into actual messages ("Listed in SBL", "ISP Policy").
  • Delisting Links: Provides direct URLs to removal forms when available.
  • Zero Dependencies: Just pure Javascript logic.

Included Lists

We maintain definitions for the most reliable and widely used lists:

  • Spamhaus ZEN (SBL, CSS, XBL, PBL) - The gold standard
  • Spamhaus DQS (ZEN) - Same result parsing, but query via Spamhaus DQS (requires a DQS key)
  • Barracuda (BRBL)
  • SpamCop
  • SORBS (Aggregate)
  • UCEPROTECT (Level 1)
  • Hostkarma
  • Backscatterer
  • Invaluement SIP
  • SpamCannibal
  • DroneBL
  • Spam Eating Monkey (SEM-BLACK)
  • URIBL Black
  • RV-SOFT Technology
  • ZapBL
  • Suomispam Reputation
  • Kempt.net
  • Korea Services
  • NiX Spam
  • Passive Spam Block List (PSBL)
  • InterServer RBL
  • Spamhaus SBL
  • all.s5h.net
  • Abuse.ch Combined
  • UCEPROTECT Level 2
  • Abuse.ch Drone
  • 0spam RBL
  • Singular TTK PTE
  • SpamRats Spam
  • Spamsources Fabel
  • Virus RBL JP
  • Woody's SMTP Blacklist
  • WPBL
  • UCEPROTECT Level 3
  • Gweep Proxy
  • Gweep Relays
  • Abuse.ch Spam
  • Digibase Spambot
  • Lashback UBL
  • WormRBL
  • 0spam Blocklist
  • Team Cymru Bogons
  • SpamRats Dyna
  • SpamRats NoPtr
  • Nether.net Relays
  • Imp.ch Spam RBL
  • Mailspike Z
  • Anonmails.de
  • Pedantic.org
  • GBUdb Truncate
  • LashBack UBL

How to use it

1. Install

npm install uptimeify-dnsbl

2. Check an IP

import { getLookupDomains, parseLookupResult } from "uptimeify-dnsbl";
import { resolve4 } from "node:dns/promises";

async function check(ip) {
	// 1. Get the list of domains to query
	const checks = getLookupDomains(ip, {
		spamhaus: {
			// Default: "zen" (public). Use "dqs" to query Spamhaus via DQS.
			mode: process.env.SPAMHAUS_DQS_KEY ? "dqs" : "zen",
			dqsKey: process.env.SPAMHAUS_DQS_KEY,
		},
	});
	// Returns array: [{ address: "4.3.2.1.zen.spamhaus.org", listKey: "zen.spamhaus.org" }, ...]
	// Or with DQS:   [{ address: "4.3.2.1.<DQS_KEY>.zen.dq.spamhaus.net", listKey: "zen.dq.spamhaus.net" }, ...]

	// 2. Run your DNS lookups
	// We use typical Promise handling here, but you can use any async pattern
	const results = await Promise.allSettled(
		checks.map(async ({ address, listKey }) => {
			// A successful DNS A-record lookup means the IP is listed.
			// If the IP is clean, resolve4 throws ENOTFOUND.
			const [code] = await resolve4(address);
			return parseLookupResult(listKey, code);
		}),
	);

	// 3. Process results
	const listings = results
		.filter((r) => r.status === "fulfilled") // Successful lookup = Listed
		.map((r) => r.value);

	if (listings.length > 0) {
		console.log(`❌ IP ${ip} is listed on:`);
		listings.forEach((listing) => {
			console.log(`   - ${listing.name}`);
			console.log(`     Reason: ${listing.reason}`);
			console.log(`     Delist: ${listing.delistUrl}`);
		});
	} else {
		console.log(`✅ IP ${ip} is clean.`);
	}
}

check("127.0.0.2");

API

getLookupDomains(ip, options?)

Returns an array of objects containing the fully qualified domain to query (address) and the identifier key (listKey).

Spamhaus DQS

You can switch Spamhaus from the public DNSBL hostnames to Spamhaus DQS by passing an options object.

const checks = getLookupDomains("1.2.3.4", {
	spamhaus: {
		mode: "dqs",
		dqsKey: process.env.SPAMHAUS_DQS_KEY,
	},
});

Notes:

  • When mode: "dqs" is set, this library will generate DQS lookup domains for Spamhaus (and will not query the public Spamhaus DNSBL hostnames).
  • Keep the DQS key secret (don’t commit it to git or log it).

parseLookupResult(listKey, resultCode)

Takes the list identifier and the IP address returned by the DNS query (e.g., 127.0.0.2) and returns a rich object with the listing name, reason, and delist URL.

parseLookupResultJson(listKey, resultCode)

Same as parseLookupResult, but returns a stringified JSON representation of the result.