2017 © Pedro Peláez
 

library lib-pdns

PHP library for modifying an PowerDNS MySQL database

image

openlss/lib-pdns

PHP library for modifying an PowerDNS MySQL database

  • Wednesday, August 14, 2013
  • by nullivex
  • Repository
  • 2 Watchers
  • 3 Stars
  • 132 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 11 Versions
  • 0 % Grown

The README.md

lib-pdns

PHP library for modifying an PowerDNS MySQL database, (*1)

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

(array) PDNS::fetchDomain($name)

Get a domain by its name and return the database row, (*2)

(array) PDNS::fetchDomainByHost($name)

Take a FQDN and return its given domain database row, (*3)

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

  • $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')

  • $identifier The host identifier eg: 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

This is for raw database actions, generally more advanced usage., (*4)

(mixed) PDNS::createRecord($args)

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 * 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, (*5)

(mixed) PDNS::fetchRecord($args)

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

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

  • $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())

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

The Versions

14/08 2013

dev-master

9999999-dev http://openlss.org

PHP library for modifying an PowerDNS MySQL database

  Sources   Download

LGPL-3.0+

The Requires

 

dns powerdns pdns mysql dns

09/04 2013

dev-0.0.x-dev

dev-0.0.x-dev http://openlss.org

PHP library for modifying an PowerDNS MySQL database

  Sources   Download

LGPL-3.0+

The Requires

 

dns powerdns pdns mysql dns

09/04 2013

0.0.9

0.0.9.0 http://openlss.org

PHP library for modifying an PowerDNS MySQL database

  Sources   Download

LGPL-3.0+

The Requires

 

dns powerdns pdns mysql dns

07/04 2013

0.0.6

0.0.6.0 http://openlss.org

PHP library for modifying an PowerDNS MySQL database

  Sources   Download

LGPL-3.0+

The Requires

 

dns powerdns pdns mysql dns

07/04 2013

0.0.7

0.0.7.0 http://openlss.org

PHP library for modifying an PowerDNS MySQL database

  Sources   Download

LGPL-3.0+

The Requires

 

dns powerdns pdns mysql dns

07/04 2013

0.0.8

0.0.8.0 http://openlss.org

PHP library for modifying an PowerDNS MySQL database

  Sources   Download

LGPL-3.0+

The Requires

 

dns powerdns pdns mysql dns

03/04 2013

0.0.5

0.0.5.0 http://openlss.org

PHP library for modifying an PowerDNS MySQL database

  Sources   Download

LGPL-3.0+

The Requires

 

dns powerdns pdns mysql dns

25/03 2013

0.0.1

0.0.1.0 http://openlss.org

PHP library for modifying an PowerDNS MySQL database

  Sources   Download

LGPL-3.0+

The Requires

 

dns powerdns pdns mysql dns