PHPackages                             gbxyz/czds - 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. gbxyz/czds

ActiveLibrary

gbxyz/czds
==========

PHP client for ICANN's Centralized Zone Data Service (CZDS)

2151PHP

Since Jul 28Pushed 2y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

CZDS Library for PHP
====================

[](#czds-library-for-php)

This repository contains a simple client library for accessing [ICANN](https://icann.org)'s [Centralized Zone Data Service (CZDS)](https://czds.icann.org).

All gTLDs (top-level domains such as .com or .org) provide access to their DNS zone files via the CZDS.

You will need to create a user account on the CZDS, and request access to at least one TLD, for this to be useful!

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

[](#installation)

Add the library as a dependency to your project using `composer`:

```
composer require gbxyz/czds

```

Usage
-----

[](#usage)

Load the library into your code using Composer's autoload function:

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

Create a client object
----------------------

[](#create-a-client-object)

```
$client = new gbxyz\czds\client;

$client->login($username, $password);
```

The CZDS API issues authentication tokens that are valid for 24 hours. These tokens are cached locally so this method will only incur an HTTP round trip once per day.

Get a list of available zone files
----------------------------------

[](#get-a-list-of-available-zone-files)

This returns an array of TLDs:

```
$zones = $client->getZones();
```

This will return an array like `['foo', 'bar']`.

Save a zone file to disk
------------------------

[](#save-a-zone-file-to-disk)

```
$client->saveZone($zone, '/tmp/zonefile.txt');
```

`$zone` should be a string containing the TLD name, e.g. `xyz`.

If this fails an exception will be thrown.

Get a file descriptor for a zone file
-------------------------------------

[](#get-a-file-descriptor-for-a-zone-file)

```
$fh = $client->getZoneHandle($zone);

echo stream_get_contents($fh);
```

Get the contents of a zone file
-------------------------------

[](#get-the-contents-of-a-zone-file)

```
$zone = $client->getZoneContents($zone);

echo $zone;
```

Get an iterator
---------------

[](#get-an-iterator)

This is useful for large zones. Instead of loading the entire zone into memory, you get an object can be iterated on, which returns objects which are instances of the various `Net_DNS2_RR_*` classes.

```
$iterator = $client->getZoneRRs($zone);

foreach ($iterator as $rr) {
    printf("Owner name: %s, TTL: %u, type: %s\n", $rr->name, $rr->ttl, $rr->type);
    echo (string)$rr;
}
```

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity21

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/215a797eda2d25932071c7395786cddeebca2c83be1bc8ef50e5d3d9e6a88286?d=identicon)[gbxyz](/maintainers/gbxyz)

---

Top Contributors

[![gbxyz](https://avatars.githubusercontent.com/u/665401?v=4)](https://github.com/gbxyz "gbxyz (7 commits)")

---

Tags

czdsdnsphpzone-files

### Embed Badge

![Health badge](/badges/gbxyz-czds/health.svg)

```
[![Health](https://phpackages.com/badges/gbxyz-czds/health.svg)](https://phpackages.com/packages/gbxyz-czds)
```

PHPackages © 2026

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