Add Zone

use solutedns\Dns\Zones;
$zones = new Zones();
$zones->add(array);

Attributes:

domainstring
Zone name
recordsarray
Records to be created during zone creation. [optional]

namestring
Record name
typestring
Record type
contentstring
Record content
ttlint
Record Time To Live
prioint
Record priority
If you send any NS records in the records array these will be used instead of the default configured nameservers.
array(
  'domain' => 'example.com',
  'records' => array(
    array(
      'name' => 'example.com',
      'type' => 'A',
      'content' => '192.168.2.1',
      'ttl' => 3600,
      'prio' => 0,
    ),
  ),
);
array {
  'success' => true
  'zone' => array {
    'id' => 45
    'domain' =>'example.com'
  }
  'dnssec' => array {
    'keys' => array {
      [0]=> array {
        'id' => '14'
        'flag' => 'CSK'
        'algorithm' => '13'
        'key_tag' => '22214'
        'public_key' => 'mSJe9k8Q='
        'active' => '1'
      }
    }
    'ds' => array {
      [0]=> array {
        'key_tag' => '22214'
        'algorithm' => '13'
        'digest_type' => '1'
        'digest' => '3d833c48'
      }
    }
    'nsec' => 'NSEC3'
  }
}
DNS
array {
  'success' => true
  'zone' => array {
    'id' => 45
    'domain' => 'example.com'
  }
  'dnssec' => array {
    'errors' => array {
      [0] => array {
        'code' => 6001
        'desc' => 'Zone: example.com could not be secured.'
      }
    }
  }
}

System
array {
  'error' => array {
    'code' => 3000
    'desc' => 'Zone already exists.'
  }
}

Delete Zone

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

Attributes:

domainstring
Zone name
$domain = 'example.com';
array {
  'success'=> true
}
array {
  'error' => array {
    'code' => 3001
    'desc' => 'Zone could not be found.'
  }
}

Get Zones

use solutedns\Dns\Zones;
$zones = new Zones();
$zones->get(max, offset);

Attributes:

maxint
Maximum returned zones [optional]
offsetint
Start location to return zones [optional]
$max = 10;
$offset = 19;
'zones' => array {
  [0] => array {
    'id' => '17'
    'name' => 'example.com'
    'type' => 'NATIVE'
  }
  [1] => array {
    'id' => '237'
    'name' => 'demo.net'
    'type' => 'NATIVE'
  }
}

Import Zone

use solutedns\Dns\Zones;
$zones = new Zones();
$zones->import(array);

Attributes:

domainstring
Domain name
zonestring
BIND zone file contents
overwriteboolean
If true, removes all existing records before import
array(
  'domain' => string,
  'zone' => string,
  'overwrite' => boolean,
)
'success' => array {
  [0]=> array {
    'id' => '2315'
    'type' => 'A'
    'content' => '192.168.2.1'
    'name' => 'example.com'
    'prio' => '0'
    ttl' => '3600'
  }
  [0]=> array {
    'id' => '2316'
    'type' => 'A'
    'content' => '192.168.2.1'
    'name' => 'www.example.com'
    'prio' => '0'
    ttl' => '3600'
  }
}
DNS
'errors' => array {
  [0]=> array {
    'record' =>  array {
      'type' => 'A'
      'content' => '192.168.2.999'
      'name' => 'example.com'
      'prio' => '0'
      'ttl' => '3600'
    }
    'code' => 'INVALID_IPV6'
    'field' => 'content'
    'desc' => 'IPv4 address does not seem to be valid.'
  }
}

System
array {
  'error' => array {
    'code' => 3001
    'desc' => 'Zone could not be found.'
  }
}

Export Zone

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

Attributes:

domainstring
Domain name
$domain = 'example.com';
string
array {
  'error' => array {
    'code' => 3001
    'desc' => 'Zone could not be found.'
  }
}