PHPackages                             cyberfusion/domain-parser - 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. cyberfusion/domain-parser

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

cyberfusion/domain-parser
=========================

Library to parse domains into their subdomain, SLD, TLD, and registrable domain.

v1.8.0(2mo ago)14.4k↓33.3%1MITPHPPHP ^8.3

Since Mar 26Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/CyberfusionIO/php-cyberfusion-domain-parser)[ Packagist](https://packagist.org/packages/cyberfusion/domain-parser)[ RSS](/packages/cyberfusion-domain-parser/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (14)Versions (12)Used By (1)

php-cyberfusion-domain-parser
=============================

[](#php-cyberfusion-domain-parser)

Library to parse domains into their subdomain, SLD, TLD, and registrable domain.

This library is a wrapper around [`jeremykendall/php-domain-parser`](https://github.com/jeremykendall/php-domain-parser), focussed on ease of use.

Install
=======

[](#install)

Composer
--------

[](#composer)

Run the following command to install the package from Packagist:

```
composer require cyberfusion/domain-parser

```

Usage
=====

[](#usage)

Example
-------

[](#example)

```
use Cyberfusion\DomainParser\Parser;

$parser = new Parser();
$parsedDomain = $parser->domain('www.cyberfusion.nl');

$parsedDomain->getRegistrableDomain(); // cyberfusion.nl
$parsedDomain->getSld(); // cyberfusion
$parsedDomain->getTld(); // nl
$parsedDomain->hasSubdomain(): // true
$parsedDomain->getSubdomain(); // www
$parsedDomain->isApexDomain(); // false
$parsedDomain->getFqdn(); // www.cyberfusion.nl
```

Providers
---------

[](#providers)

### [Public Suffix List](https://publicsuffix.org/) (recommended)

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

```
$parser = new Parser(provider: new PublicSuffixList());
```

### [IANA](https://data.iana.org/TLD/tlds-alpha-by-domain.txt)

[](#iana)

```
$parser = new Parser(provider: new IANATopLevelDomainList());
```

Caching
-------

[](#caching)

This package caches data. to prevent too many requests to providers. You can provide your own cache to `Parser`, or use the included file cache.

For example, use the default cache store in Laravel:

```
$parser = new Parser(
    cache: Cache::store(),
    provider: new PublicSuffixList()
);
```

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance88

Actively maintained with recent releases

Popularity23

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 57.4% 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 ~109 days

Recently: every ~265 days

Total

11

Last Release

60d ago

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

v1.5.0PHP ^8.3

### Community

Maintainers

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

---

Top Contributors

[![WilliamDEdwards](https://avatars.githubusercontent.com/u/12184311?v=4)](https://github.com/WilliamDEdwards "WilliamDEdwards (31 commits)")[![dvdheiden](https://avatars.githubusercontent.com/u/90568118?v=4)](https://github.com/dvdheiden "dvdheiden (23 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleECS

Type Coverage Yes

### Embed Badge

![Health badge](/badges/cyberfusion-domain-parser/health.svg)

```
[![Health](https://phpackages.com/badges/cyberfusion-domain-parser/health.svg)](https://phpackages.com/packages/cyberfusion-domain-parser)
```

###  Alternatives

[stevebauman/location

Retrieve a user's location by their IP Address

1.3k7.6M65](/packages/stevebauman-location)[bakame/laravel-domain-parser

Laravel package to integrate PHP Domain parser.

26534.8k4](/packages/bakame-laravel-domain-parser)[nativephp/mobile

NativePHP for Mobile

82724.0k43](/packages/nativephp-mobile)[bensampo/laravel-embed

Painless responsive embeds for videos, slideshows and more.

142146.8k](/packages/bensampo-laravel-embed)[glhd/conveyor-belt

14797.0k](/packages/glhd-conveyor-belt)[pulkitjalan/ip-geolocation

IP Geolocation Wrapper with Laravel Support

89164.9k1](/packages/pulkitjalan-ip-geolocation)

PHPackages © 2026

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