Database Interaction

use solutedns\System\db;
$db = db::get();
$db->PDO_STATEMENT

With the db class you can directly call any PDO statement available in PHP. Depending on the namespace your in you might need to call the global PDO class by adding an backslash before the PDO class name itself.

$stmt = $db->prepare("SELECT id FROM domains where name = :domain");
$stmt->execute(array(':domain' => 'example.com'));
$row = $stmt->fetch(PDO::FETCH_ASSOC);

Zone Exists

use solutedns\Dns\Zones;
$zones = new Zones();
$zones->exists(string);

Attributes:

domainstring
Zone name

Please note an Error Code may be returned instead of a boolean.

$domain = 'example.com';
boolean

Slave Zone

use solutedns\Dns\Zones;
$zones = new Zones();
$zones->slave(string);

Attributes:

domainstring
Zone name

Please note an Error Code may be returned instead of a boolean.

$domain = 'example.com';
boolean

Update SOA

use solutedns\Dns\Zones;
$zones = new Zones();
$zones->update(string, integer);

Attributes:

domainstring
Zone name
domain idint
Avoid an extra lookup when the domain id is known [optional]

Please note an Error Code may be returned instead of a boolean.

$domain = 'example.com';
$domain_id = 22;
boolean

Records in Zone

use solutedns\Dns\Records;
$records = new Records();
$records->size(string);

Attributes:

domainstring
Zone name

Please note an Error Code may be returned instead of an integer or boolean.

$domain = 'example.com';
integer/false

Pre Validate

use solutedns\Dns\Validate;
$validate = new Validate();
$validate->pre(array);

Attributes:

domainstring
Zone name
typestring
Record type
Namestring
Record name
contentstring
Record content
priointeger
Record prioirity
ttlinteger
Record time to live

Please note this is an preliminary validation function. No zone checks are performed being but not limited to: unique record, zone exists and non-alias targeting checks.

array(
  'domain' => 'example.com',
  'name' => 'example.com',
  'type' => 'A',
  'content' => '192.168.2.1',
  'ttl' => 3600,
  'prio' => 0,
);
Success
NULL

Error
array {
  'code' => 'INVALID_IPV4'
  'desc' => 'IPv4 address does not seem to be valid.'
  'field' => 'content'
}

SSH Session

use solutedns\Dns\Dnssec;
$dnssec= new Dnssec();
$dnssec->session();

All functions which use an SSH connection to the nameserver have an session parameter. This can be used to avoid the function reconnecting to the server every time it’s called. This is typically useful when performing multiple actions which require SSH access.

You can either store the session in an variable and send it along with each function call:

$session = $dnssec->session();
$dnssec->rectify('example.com', $session);
$dnssec->rectify('demo.com', $session);

Or store the session in the class itself:

$dnssec->session();
$dnssec->rectify('example.com');
$dnssec->rectify('demo.com');
$dnssec->session();

$dnssec->secure('example.net');
$dnssec->nsec3('example.net');
$dnssec->rectify('example.net');
Object/Exception