PHPackages                             tomcan/public-suffix-list - 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. tomcan/public-suffix-list

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

tomcan/public-suffix-list
=========================

A PHP consumable version of the DNS top level domains public suffix list from publicsuffix.org.

v2.4.1(1y ago)1584↓50%1MITPHPPHP &gt;=7.4

Since Feb 6Pushed 1y ago1 watchersCompare

[ Source](https://github.com/TomCan/public-suffix-list)[ Packagist](https://packagist.org/packages/tomcan/public-suffix-list)[ RSS](/packages/tomcan-public-suffix-list/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (13)Used By (1)

PHP Public Suffix List
======================

[](#php-public-suffix-list)

A PHP consumable version of the DNS top level domains public suffix list from publicsuffix.org. It contains the actual list, and is updated periodically.

The library also includes a easy way to check for validity, or derive the TLD from a given domain name.

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

[](#installation)

You can install the library through composer

```
composer require tomcan/public-suffix-list

```

The `v1.5.x` versions of the library support PHP 5.6 and above. This version is no longer maintained and may or may not receive list updates, but no new features.

The `v2.x.y` versions of the library support PHP 7.4 and above.

Usage
-----

[](#usage)

There are 2 variants of the list. The `PSLIcann` class contains all 'official' TLDs as defined by ICANN. The 'PSLFull' class also contains private TLDs that are children of the ICANN list, but also allow registration by users, or even domains of large/popular services like AWS S3.

```
$psl = new PSLIcann();
// check if tld is valid
$valid = $psl->isTld('be'); // -> true
$valid = $psl->isTld('tom.be); // -> false
// get tld of given domain
$tld = $psl->getTldOfDomain('mt.tom.be'); // -> be
$tld = $psl->getTldOfDomain('oh.fc.it'); // -> fc.it

$psl = new PSLFull();
// check if tld is valid
$valid = $psl->isTld('s3.dualstack.ap-east-1.amazonaws.com'); // -> true
// get tld of given domain
$tld = $psl->getTldOfDomain('someappname.3.azurestaticapps.net'); // -> 3.azurestaticapps.net
// get type of given tld
$type = $psl->getType('be'); // -> icann
$type = $psl->getType('3.azurestaticapps.net'); // -> private

```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance43

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity45

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 ~0 days

Total

12

Last Release

456d ago

Major Versions

v1.5.0 → v2.0.02025-02-06

1.5.x-dev → v2.3.02025-02-06

PHP version history (2 changes)v1.0.0PHP &gt;=5.6

v2.0.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/a525acc6df0983b6cc74121062bc2ec4cfcb163a2252ba1fb27d5e04ff67243d?d=identicon)[TomCan](/maintainers/TomCan)

---

Top Contributors

[![TomCan](https://avatars.githubusercontent.com/u/2892620?v=4)](https://github.com/TomCan "TomCan (43 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tomcan-public-suffix-list/health.svg)

```
[![Health](https://phpackages.com/badges/tomcan-public-suffix-list/health.svg)](https://phpackages.com/packages/tomcan-public-suffix-list)
```

###  Alternatives

[ps/fluent-traversable

Support for operating on collections and arrays by functional way. Inspired by guava's FluentIterable, java8 Stream framework and scala stuff

2929.4k1](/packages/ps-fluent-traversable)

PHPackages © 2026

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