PHPackages                             openlss/lib-pdns - 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. [Database &amp; ORM](/categories/database)
4. /
5. openlss/lib-pdns

ActiveLibrary[Database &amp; ORM](/categories/database)

openlss/lib-pdns
================

PHP library for modifying an PowerDNS MySQL database

0.0.9(13y ago)61481LGPL-3.0+PHPPHP &gt;=5.3.2

Since Mar 25Pushed 12y ago2 watchersCompare

[ Source](https://github.com/nullivex/lib-pdns)[ Packagist](https://packagist.org/packages/openlss/lib-pdns)[ Docs](http://openlss.org)[ RSS](/packages/openlss-lib-pdns/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (5)Versions (11)Used By (0)

lib-pdns
========

[](#lib-pdns)

PHP library for modifying an PowerDNS MySQL database

Usage
-----

[](#usage)

```
//setup the database config
$db = array(
	 'host'		=>	'localhost'
	,'user'		=>	'pdns'
	,'password'	=>	''
	,'driver'	=>	'mysql'
	,'port'		=>	3306
);
Config::set('pdns.db',$db); unset($db);

//getters
$domain = PDNS::fetchDomain('test.com');
$domain = PDNS::fetchDomainByHost('www.test.com');
$record = PDNS::fetchRecord(array('id'=>1));

//update - updates or creates record and finds it by ident
//this is the main function unless advanced actions are needed
$rv = PDNS::update('www.test.com','1.2.4.5','A');
if($rv === false)
	throw new Exception('Failed to update record: www.test.com');

//delete a record the preferred way
$rv = PDNS::delete('www.test.com','1.2.3.4','A');

//raw create record
$id = PDNS::createRecord(array(
	 'domain_id'		=>	1
	,'name'				=>	'ww1.test.com'
	,'type'				=>	'A'
	,'content'			=>	'1.2.3.4'
	,'ttl'				=>	60
	,'prio'				=>	''
));

//update raw record
$rv = PDNS::updateRecord(1,array('type'=>'CNAME','content'=>'test.com'));

//delete raw record
$rv = PDNS::deleteRecord(array('id'=>1));
```

Reference
---------

[](#reference)

### (array) PDNS::fetchDomain($name)

[](#array-pdnsfetchdomainname)

Get a domain by its name and return the database row

### (array) PDNS::fetchDomainByHost($name)

[](#array-pdnsfetchdomainbyhostname)

Take a FQDN and return its given domain database row

### (mixed) PDNS::update($identifier,$data,$type='A')

[](#mixed-pdnsupdateidentifierdatatypea)

- $identifier Ident that gets passed to PDNS::fetchDomainByHost()
- $data The record data eg: 1.2.3.4
- $type The record type defaults to A Returns the record ID on creation, TRUE on update, FALSE on failure

### (mixed) PDNS::delete($identifier,$data,$type='A')

[](#mixed-pdnsdeleteidentifierdatatypea)

- $identifier The host identifier eg: [www.test.com](http://www.test.com)
- $data The record data eg: 1.2.3.4
- $type Record type which defaults to A Returns FALSE on failure, TRUE on success

Internal Refernce
-----------------

[](#internal-refernce)

This is for raw database actions, generally more advanced usage.

### (mixed) PDNS::createRecord($args)

[](#mixed-pdnscreaterecordargs)

Takes any amount of arguments to create a database record. The current record schema looks like this

- id Record ID number
- domain\_id Domain ID number
- name The record name eg: [www.test.com](http://www.test.com)
- type Record type eg: A
- content Record content eg: 1.2.3.4
- ttl Record TTL eg: 60
- prio The record priority mainly used for MX records eg: 10
- change\_date This gets set automatically

### (mixed) PDNS::fetchRecord($args)

[](#mixed-pdnsfetchrecordargs)

Similar to create by takes an array of arguments related to the schema and returns the database row. Returns FALSE on failure

### (bool) PDNS::updateRecord($id=null,$args=array())

[](#bool-pdnsupdaterecordidnullargsarray)

- $id Record ID number
- $args Parameters to update, see the schema for PDNS::createRecord() Returns TRUE on success, FALSE on failure

### (bool) PDNS::deleteRcord($args=array())

[](#bool-pdnsdeletercordargsarray)

- $args Similar to PDNS::fetchRecord() Returns TRUE on success, FALSE on failure

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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 ~2 days

Total

9

Last Release

4831d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/83c8e9d55e3ebafb0621a441a51af8f551f61a274fde5400459a29cc320b7b75?d=identicon)[nullivex](/maintainers/nullivex)

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

---

Top Contributors

[![nullivex](https://avatars.githubusercontent.com/u/2321375?v=4)](https://github.com/nullivex "nullivex (12 commits)")[![Spudz76](https://avatars.githubusercontent.com/u/2391234?v=4)](https://github.com/Spudz76 "Spudz76 (4 commits)")

---

Tags

dnspowerdnspdnsmysql dns

### Embed Badge

![Health badge](/badges/openlss-lib-pdns/health.svg)

```
[![Health](https://phpackages.com/badges/openlss-lib-pdns/health.svg)](https://phpackages.com/packages/openlss-lib-pdns)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M117](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

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