PHPackages                             rahulmukati/hetzner-dns - 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. rahulmukati/hetzner-dns

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

rahulmukati/hetzner-dns
=======================

All new and simple Hetzner DNS library for PHP.

1.0.1(5y ago)1165↓50%2MITPHPPHP &gt;=5.6

Since Aug 15Pushed 4y ago1 watchersCompare

[ Source](https://github.com/rahulmukati/hetzner-dns)[ Packagist](https://packagist.org/packages/rahulmukati/hetzner-dns)[ Docs](https://github.com/rahulmukati/hetzner-dns)[ RSS](/packages/rahulmukati-hetzner-dns/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (3)Used By (0)

 [![](https://raw.githubusercontent.com/rahulmukati/hetzner-dns/master/hetzner.png)](https://dns.hetzner.com/)

Hetzner DNS
-----------

[](#hetzner-dns)

> All new and simple Hetzner DNS library for PHP.

Features
--------

[](#features)

- **Lightweight** - Less than 5 KB, portable with only one file
- **Easy** - Extremely easy to learn and use, friendly construction
- **Powerful** - Supports almost all Hetzner DNS features
- **Friendly** - Works well with every PHP frameworks, like Laravel, Codeigniter, Yii, Slim, and framework which supports singleton extension or composer
- **Free** - Under MIT license, you can use it anywhere whatever you want

Requirement
-----------

[](#requirement)

PHP 5.6+, recommend PHP 7.0+

Get Started
-----------

[](#get-started)

### Install via composer

[](#install-via-composer)

Add to composer.json configuration file.

```
$ composer require rahulmukati/hetzner-dns

```

And update the composer

```
$ composer update

```

```
// If you installed via composer, just use this code to require autoloader on the top of your projects.
require 'vendor/autoload.php';

// Using HetznerDNS namespace
use HetznerDNS\HetznerDNS;

// Initialize
$hdns = new HetznerDNS([
  'api_token' => 'YOURAPITOKENHERE'
]);
```

**Create DNS Zone**

```
$hdns->createZone([
  'name' => 'example.com', //Required: String
  'ttl' => '3600' //Optional: Integer
]);
```

**Import DNS Zone file**

```
$body = '$ORIGIN example.com.
$TTL 3600
; SOA Records
@		IN	SOA	ns1.yourdomain.com. dns.yourdomain.com. 2020081403 86400 10800 3600000 3600
; NS Records
@		IN	NS	ns1.yourdomain.com.
@		IN	NS	ns2.yourdomain.com.
; A Records
@		IN	A	192.168.1.1
; CNAME Records
www		IN	CNAME	example.com.';

$hdns->importZoneFile('ZoneIDHere', $body);
```

**Export DNS Zone file**

```
$hdns->exportZoneFile('ZoneIDHere');
```

**Get all DNS Zones**

```
$hdns->getZones([
  'name' => '', //Optional: String
  'page' => '', //Optional: Number >= 1
  'per_page' => '', //Optional: Number  '', //Optional: String
]);
```

**Get single DNS Zone**

```
$hdns->getZone('ZoneIDHere');
```

**Update DNS Zone**

```
$hdns->updateZone('ZoneIDHere', [
  'name' => 'example.com', //Required: String
  'ttl' => '3600' //Optional: Integer
]);
```

**Delete DNS Zone**

```
$hdns->deleteZone('ZoneIDHere');
```

**Create DNS Record**

```
$hdns->createRecord([
  'zone_id' => 'ZoneIDHere', //Required: String
  'name' => '@', //Required: String
  'type' => 'CNAME', //Required: String ("A" "AAAA" "NS" "MX" "CNAME" "RP" "TXT" "SOA" "HINFO" "SRV" "DANE" "TLSA" "DS" "CAA")
  'value' => 'example.com', //Required
  'ttl' => '3600' //Optional: Integer
]);
```

**Get all DNS Records**

```
$hdns->getRecords([
  'zone_id' => 'ZoneIDHere', //Optional: String
  'page' => '1', //Optional: Number
  'per_page' => '10', //Optional: Number
]);
```

**Get single DNS Record**

```
$hdns->getRecord('RecordIDHere');
```

**Update DNS Record**

```
$hdns->updateRecord('RecordIDHere', [
  'zone_id' => 'ZoneIDHere', //Required: String (ID of zone this record is associated with)
  'name' => '@', //Required: String
  'type' => 'CNAME', //Required: String ("A" "AAAA" "NS" "MX" "CNAME" "RP" "TXT" "SOA" "HINFO" "SRV" "DANE" "TLSA" "DS" "CAA")
  'value' => 'example.com', //Required
  'ttl' => '3600' //Optional: Integer
]);
```

**Delete DNS Record**

```
$hdns->deleteRecord('RecordIDHere');
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity51

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

2

Last Release

2103d ago

### Community

Maintainers

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

---

Top Contributors

[![rahulmukati](https://avatars.githubusercontent.com/u/21099554?v=4)](https://github.com/rahulmukati "rahulmukati (2 commits)")

---

Tags

dnshetznerhetzner cloudhetzner dnsfree dnsphp dns

### Embed Badge

![Health badge](/badges/rahulmukati-hetzner-dns/health.svg)

```
[![Health](https://phpackages.com/badges/rahulmukati-hetzner-dns/health.svg)](https://phpackages.com/packages/rahulmukati-hetzner-dns)
```

###  Alternatives

[daverandom/libdns

DNS protocol implementation written in pure PHP

16339.1M9](/packages/daverandom-libdns)[spatie/dns

Retrieve DNS records

6082.3M17](/packages/spatie-dns)[orrison/cumulus

Import DNS records from Laravel Vapor into Cloudflare

3817.1k](/packages/orrison-cumulus)[mesour/dns-checker

DNS checker written in PHP for check and compare real DNS records for domain.

2024.6k](/packages/mesour-dns-checker)[astrotomic/laravel-dns

327.4k](/packages/astrotomic-laravel-dns)

PHPackages © 2026

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