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

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

x2nx/domain-parser
==================

Returns complete whois and domain info parser domain information

v0.0.6(7mo ago)265MITPHPPHP &gt;=8.0

Since Nov 8Pushed 7mo ago1 watchersCompare

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

READMEChangelog (5)DependenciesVersions (7)Used By (0)

Domain-parser
=============

[](#domain-parser)

Returns complete whois and domain info parser domain information

Getting Started
---------------

[](#getting-started)

Install using composer:

```
composer require x2nx/domain-parser
```

X2nx Domains parser uses a public suffix PHP dataset auto-generated from the [publicsuffix.org](https://publicsuffix.org/). The dataset get periodically updates from us, but you can also manually update it by cloning this library and running the import script with the import command:

```
php ./data/import.php
```

> If you want to parse ordinary web urls then use `$host = parse_url($return, PHP_URL_HOST); $domain = new \X2nx\DomainParser\Parser($host);` to get the domain object.

Library API
-----------

[](#library-api)

- **get()** - Return you full domain name.
- **getTLD()** - Return only the top-level-domain.
- **getSuffix()** - Return only the public suffix of your domain, for example: co.uk, ac.be, org.il, com, org.
- **getRegisterable()** - Return the registered or registrable domain, which is the public suffix plus one additional label.
- **getName()** - Returns only the registerable domain name. For example, blog.example.com will return 'example', and demo.co.uk will return 'demo'.
- **getSub()** - Returns the full sub domain path for you domain. For example, blog.example.com will return 'blog', and subdomain.demo.cn will return 'subdomain.demo'.
- **getWhoisServer()** - Returns whois server url info.
- **getWhoisInfo()** - Returns whois info.
- **getWhoisFormatted()** - Returns formatted whois information.
- **getWhoisParsed()** - Returns whois structured data.
- **getRdapServer()** - Returns rdap server url info.
- **getRdapInfo()** - Returns rdap info.
- **getRdapFormatted()** - Returns formatted rdap information.
- **getRdapParsed()** - Returns rdap structured data.
- **isKnown()** - Returns true if public suffix is know and false otherwise.
- **isICANN()** - Returns true if the public suffix is found in the ICANN DOMAINS section of the public suffix list.
- **isPrivate()** - Returns true if the public suffix is found in the PRIVATE DOMAINS section of the public suffix list.
- **isTest()** - Returns true if the domain TLD is 'locahost' or 'test' and false otherwise.

Support functions
-----------------

[](#support-functions)

- **iana\_whois($domain,$is\_server)** Return the original whois information of the domain name
- **iana\_domain($domain)** Return the components of the domain name, including subdomain, name, top-level domain, original whois information, etc
- **iana\_domain\_info($domain, $format)** Returns the unified structure information of the domain name. The first parameter is the domain name, and the second parameter is the return format. The return format supports text|array|json

Copyright and license
---------------------

[](#copyright-and-license)

The MIT License (MIT)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance65

Regular maintenance activity

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

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

Total

6

Last Release

214d ago

### Community

Maintainers

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

---

Top Contributors

[![okxaas](https://avatars.githubusercontent.com/u/15893123?v=4)](https://github.com/okxaas "okxaas (1 commits)")

### Embed Badge

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

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

###  Alternatives

[vcian/pulse-active-sessions

A Laravel Pulse card to show active user session.

11469.2k](/packages/vcian-pulse-active-sessions)[norberttech/aceeditor-bundle

Bundle that integrate excellent JavaScript ace editor into Symfony Form.

28310.8k](/packages/norberttech-aceeditor-bundle)[tomloprod/radiance

A deterministic mesh gradient avatar generator for PHP.

1393.7k](/packages/tomloprod-radiance)[chefkoch/morphoji

A library to convert UTF-8 emoji characters to latin1 placeholders and vice versa.

14136.9k1](/packages/chefkoch-morphoji)[epessine/axis

Draw charts with a simple API on Laravel

265.6k](/packages/epessine-axis)

PHPackages © 2026

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