Welcome to the documentation for the SoluteDNS Core which is an library for DNS Management of PowerDNS nameservers with an MySQL back-end. The Core is an development friendly solution which can be used stand-alone or together with our integrations.

Configuration

For a new installation rename the config.php.new file to config.php.


License

If you have an license for the SoluteDNS core enter it here. If you want to use the free edition remove the license option from the configuration or leave it empty.


Database

Depending on your PowerDNS configuration set the type value accordingly. Typically the master type is used when you use AXFR zone transfer and the native type is used when you use database replication.

A support database can be used to enable additional functions. For more information please see: Support Database


Records

The allowed options gives you the ability to limit the allowed records types. Please note this is an global setting.

Using the limit option you can set an maximum allowed records per zone. Leave it 0 to disable.

The :domain: selector in the hostmaster value is replaced by the zone name. If custom_primary is set to true this can be overwritten. Otherwise the default hostmaster will be used every time the SOA record is updated.


Nameservers

Add all the nameservers which belong to your DNS cluster here. The first nameserver is the primary nameserver which is connected to the SoluteDNS Core.


Health

The self_check option checks if the nameservers are set correctly on all levels.

The consistency_check will check if all nameservers in the cluster have the same SOA serial and all nameservers are authoritative for the zone.

The registry_check will check if the registry and the zone agree on the same nameservers.

The record_check is performed by PowerDNS and will check for any errors within the zone.


Debug

When debug mode is enabled it will print all info, warning and error messages. Also see the Error Manual for more information.


Audit Log

For audit purposes you can enable audit logging. For this function to work you must also setup a support database.


Custom Regex

For selected validation rules you can set an custom regex. Only add the custom regex values to the configuration file when needed.

return [
  'license' => 'PRO_xxxxxxxxxxxxxxxxx',
  'database' => [
    'host' => '127.0.0.1',
    'port' => '',
    'name' => 'ns',
    'user' => 'pdns',
    'pass' => 'password',
    'type' => 'native' # native/master
    'support' => new PDO (...) # Optional support database
  ],
  'ssh' => [
    'host' => '127.0.0.1',
    'port' => '',
    'user' => 'pdns',
    'pass' => 'password',
    'private_key' => '',
    'powerdns_version' => '4' # 3/4
  ],
  'nameservers' => [
    '0' => 'ns0.solutedns.com',
    '1' => 'ns1.solutedns.com',
    '2' => 'ns2.solutedns.com'
  ],
  'records' => [
    'allowed' => 'A,AAAA,ALIAS,CNAME,HINFO,MX,NS,SRV,TLSA,TXT',
    'limit' => 0,
    'soa' => [
      'hostmaster' => 'hostmater.:domain:',
      'serial' => 'default', # default/epoch/last
      'refresh' => 3600,
      'retry' => 600,
      'expire' => 604800,
      'ttl' => 3600
    ],
    'custom_primary' => true,
    'disable_soa' => false,
  ],
  'zones' => [
    'unique_only' => false,
  ],
  'dnssec' => [
    'enabled' => true,
    'auto_rectify' => true,
    'auto_keys' => true,
    'auto_nsec3' => true,
  ],
  'health' => [
    'self_check' => true,
    'consistency_check' => true,
    'registry_check' => true,
    'record_check' => true
  ],
  'system' => [
    'debug' => false,
    'audit_log' => false,
    'regex' => [
      'VALIDATE_IPV4' => '#[\s\S]#',
      'VALIDATE_IPV6' => '#[\s\S]#',
      'VALIDATE_FQHN' => '#[\s\S]#',
      'VALIDATE_FQDN' => '#[\s\S]#',
      'VALIDATE_TYPES' => '#[\s\S]#',
      'VALIDATE_QUOTED' => '#[\s\S]#'
    ],
  ],
];

Include the Core

You can include the SoluteDNS Core in your script by simply including the init.php php file.

If you are using autoload you can also load the Core using:

$loader->addPsr4('solutedns\\', __DIR__);

Depending on which required dependencies you have you might also need to autoload scripts from the vendor directory of the SoluteDNS Core. The init.php can be used as example.

Read Only Mode

The Records class has an read only modes which can be enabled by calling the readonly function as shown in the example below:

$records = new Records();
$records->readonly();