PHPackages                             slicksky/spam-blacklist-query - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. slicksky/spam-blacklist-query

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

slicksky/spam-blacklist-query
=============================

Find out if a domain or IP is blacklisted on the most popular spam listing services.

v0.2.6(3y ago)1132.5k↑242.9%[1 issues](https://github.com/kirilcvetkov/spam-blacklist-query/issues)MITPHPPHP &gt;=8.0CI failing

Since Jan 2Pushed 2y ago1 watchersCompare

[ Source](https://github.com/kirilcvetkov/spam-blacklist-query)[ Packagist](https://packagist.org/packages/slicksky/spam-blacklist-query)[ Docs](https://slicksky.com)[ RSS](/packages/slicksky-spam-blacklist-query/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (9)Dependencies (5)Versions (10)Used By (0)

Spam Blacklist Query
====================

[](#spam-blacklist-query)

This small package helps you find out if a domain or IP is blacklisted on the most popular spam listing services.

Here's how it works:

1. Test the input domain against Domain Spam Blacklist services (DNSBL URI):
    - APEWS Level 1 ()
    - Scientific Spam URI ()
    - SEM URI ()
    - SEM URIed ()
    - SORBS URI ()
    - SpamHaus Zen ()
    - SURBL multi ()
    - URIBL multi ()
2. Retrieve mail servers for the given domain (MX records).
3. Get the list of IPs for each mail servers (A records).
4. Test each IP against these IP Spam Blacklist services (DNSBL IP):
    - UCEPROTECT ()
    - DroneBL ()
    - SORBS ()
    - SpamHaus Zen ()
    - SpamCop.net ()
    - DSBL ()

Installation
------------

[](#installation)

Run this command in your project's root folder

```
composer require slicksky/blacklist-spam-query
```

Usage
-----

[](#usage)

```
require 'vendor/autoload.php';

use SlickSky\SpamBlacklistQuery\Domain;

// Test a Domain
$sampleDomain = 'google.com';
$domainResults = (new Domain($sampleDomain))
   ->query(); // returns Collection

// Get the listed records only
$listedIps = $domainResults->listed(); // returns Collection

// Ask if the domain or any IP records are listed
$isListed = $domainResults->isListed(); // returns bool
```

### Customizing blacklist services (DNSBL)

[](#customizing-blacklist-services-dnsbl)

There are 4 sets of Blacklists in the Config class:

1. Config::BLACKLISTS\_IP - used to test IPs
2. Config::BLACKLISTS\_URI - used to test domains/subdomains
3. Config::BLACKLISTS\_EXTENDED - mixed list of most popular blacklists
4. Config::BLACKLISTS\_FULL - mixed list of all blacklists I've found so far In the Config class, you can customize blacklistsIp and/or blacklistsUri. If you omit any, the internal list will be used. If you want to turn off IP or URI queries, pass an empty array to blacklistsIp or blacklistsUri. Blacklist array template: \['service address' =&gt; 'name'\]

```
use SlickSky\SpamBlacklistQuery\Config;
use SlickSky\SpamBlacklistQuery\Domain;

$blacklists = new Config(
   blacklistsIp: ['dnsbl-1.uceprotect.net' => 'UCEPROTECT'],
   blacklistsUri: ['zen.spamhaus.org' => 'SpamHaus Zen'],
);

$domainResults = (new Domain($sampleDomain, $blacklists))
   ->query(); // returns Collection
```

### Further customizations

[](#further-customizations)

```
use SlickSky\SpamBlacklistQuery\Blacklist;
use SlickSky\SpamBlacklistQuery\Config;
use SlickSky\SpamBlacklistQuery\MxIp;

// Test a single IP
$ip = new MxIp('8.8.8.8');

// Is this IP valid?
$isInvalid = $ip->isInvalid(); // returns bool

// Query the IP
foreach (Config::BLACKLISTS_IP as $serviceHost => $serviceName) {
   $isListed = $ip->query(
      new Blacklist($serviceHost, $serviceName, $ip->reverse()),
   ); // returns bool
}

// Get the listed state
$isListed = $ip->isListed(); // returns bool

// Get the blacklists objects and their results
$blacklistsResults = $ip->blacklists; // Collection
```

Results
-------

[](#results)

```
SlickSky\SpamBlacklistQuery\Result::__set_state([
   'items' => [
    SlickSky\SpamBlacklistQuery\MxRecord::__set_state([
       'host' => 'google.com',
       'class' => 'IN',
       'ttl' => 377,
       'type' => 'MX',
       'pri' => 10,
       'target' => 'smtp.google.com',
       'listed' => false,
       'blacklists' =>
      SlickSky\SpamBlacklistQuery\Collection::__set_state([
         'items' => [
          SlickSky\SpamBlacklistQuery\Blacklist::__set_state([
             'listed' => false,
             'host' => 'dnsbl-1.uceprotect.net',
             'name' => 'UCEPROTECT',
             'ipReverse' => 'google.com',
             'responseTime' => 0.012,
          ]),
        ],
      ]),
       'ips' =>
      SlickSky\SpamBlacklistQuery\Collection::__set_state([
         'items' => [
          SlickSky\SpamBlacklistQuery\MxIp::__set_state([
             'blacklists' =>
            SlickSky\SpamBlacklistQuery\Collection::__set_state([
               'items' => [
                SlickSky\SpamBlacklistQuery\Blacklist::__set_state([
                   'listed' => false,
                   'host' => 'dnsbl-1.uceprotect.net',
                   'name' => 'UCEPROTECT',
                   'ipReverse' => '27.2.251.142',
                   'responseTime' => 0.012,
                ]),
              ],
            ]),
             'invalid' => false,
             'listed' => false,
             'ip' => '142.251.2.27',
          ]),
        ],
      ]),
    ]),
  ],
])
```

License
-------

[](#license)

The Spam Blacklist Query is open-sourced software licensed under the MIT license.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~13 days

Recently: every ~25 days

Total

9

Last Release

1174d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8b589c8f1e3d8e0ee1238fa317548eea758897dd0961cf5685cd6ab74703bbad?d=identicon)[kirilcvetkov](/maintainers/kirilcvetkov)

---

Top Contributors

[![kirilcvetkov](https://avatars.githubusercontent.com/u/13462243?v=4)](https://github.com/kirilcvetkov "kirilcvetkov (5 commits)")

---

Tags

dnsbldnsbl-checkerdnsbl-lookupsspamspamblacklist

###  Code Quality

TestsPHPUnit

Static AnalysisRector

### Embed Badge

![Health badge](/badges/slicksky-spam-blacklist-query/health.svg)

```
[![Health](https://phpackages.com/badges/slicksky-spam-blacklist-query/health.svg)](https://phpackages.com/packages/slicksky-spam-blacklist-query)
```

###  Alternatives

[yoast/comment-hacks

Make comments management easier by applying some of the simple hacks Joost gathered over decades of using WordPress.

2355.2k](/packages/yoast-comment-hacks)[webman/captcha

Captcha generator

1495.9k35](/packages/webman-captcha)[axllent/silverstripe-email-obfuscator

Email obfuscator for SilverStripe

10109.1k5](/packages/axllent-silverstripe-email-obfuscator)[jaaulde/php-ipv4

PHP classes for working with IPV4 addresses and networks.

1034.8k](/packages/jaaulde-php-ipv4)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
