PHP SDK
DNS
DNS zones and recordsets
10 methods
listZones()
List zones
Parameters
limitinteger
- Maximum number of items to return
markerstring
- ID of the last item from the previous page (for pagination)
namestring
- Filter by name (exact match or prefix with *)
statusstring
- Filter by status
typestring
- Filter by zone type
Example
<?phpuse ByCloud\SDK\ByCloud;$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);$result = $client->dns->listZones();print_r($result);
createZone()
Create zone
Parameters
namestring
required- Zone name (must end with a dot)
descriptionstring
emailstring
requiredttlinteger
typestring
mastersarray
- Master nameservers (required for SECONDARY zones)
attributesobject
Example
<?phpuse ByCloud\SDK\ByCloud;$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);$result = $client->dns->createZone(['name' => 'example.com.','email' => 'admin@example.com']);print_r($result);
getZone()
Get zone
Parameters
zone_idstring
required- DNS Zone ID
Example
<?phpuse ByCloud\SDK\ByCloud;$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);$result = $client->dns->getZone(['zone_id' => '550e8400-e29b-41d4-a716-446655440000']);print_r($result);
updateZone()
Update zone
Parameters
zone_idstring
required- DNS Zone ID
descriptionstring
emailstring
ttlinteger
mastersarray
Example
<?phpuse ByCloud\SDK\ByCloud;$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);$result = $client->dns->updateZone(['zone_id' => '550e8400-e29b-41d4-a716-446655440000']);print_r($result);
deleteZone()
Delete zone
Parameters
zone_idstring
required- DNS Zone ID
Example
<?phpuse ByCloud\SDK\ByCloud;$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);$result = $client->dns->deleteZone(['zone_id' => '550e8400-e29b-41d4-a716-446655440000']);print_r($result);
listRecordsets()
List recordsets
Parameters
zone_idstring
required- DNS Zone ID
limitinteger
- Maximum number of items to return
markerstring
- ID of the last item from the previous page (for pagination)
namestring
- Filter by name (exact match or prefix with *)
statusstring
- Filter by status
typestring
- Filter by record type
Example
<?phpuse ByCloud\SDK\ByCloud;$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);$result = $client->dns->listRecordsets(['zone_id' => '550e8400-e29b-41d4-a716-446655440000']);print_r($result);
createRecordset()
Create recordset
Parameters
zone_idstring
required- DNS Zone ID
namestring
required- Record name (FQDN, must end with a dot)
descriptionstring
typestring
requiredttlinteger
recordsarray
requiredExample
<?phpuse ByCloud\SDK\ByCloud;$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);$result = $client->dns->createRecordset(['zone_id' => '550e8400-e29b-41d4-a716-446655440000','name' => 'www.example.com.','type' => 'A','records' => ['192.168.1.10']]);print_r($result);
getRecordset()
Get recordset
Parameters
zone_idstring
required- DNS Zone ID
recordset_idstring
required- DNS Recordset ID
Example
<?phpuse ByCloud\SDK\ByCloud;$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);$result = $client->dns->getRecordset(['zone_id' => '550e8400-e29b-41d4-a716-446655440000','recordset_id' => '550e8400-e29b-41d4-a716-446655440000']);print_r($result);
updateRecordset()
Update recordset
Parameters
zone_idstring
required- DNS Zone ID
recordset_idstring
required- DNS Recordset ID
descriptionstring
ttlinteger
recordsarray
Example
<?phpuse ByCloud\SDK\ByCloud;$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);$result = $client->dns->updateRecordset(['zone_id' => '550e8400-e29b-41d4-a716-446655440000','recordset_id' => '550e8400-e29b-41d4-a716-446655440000']);print_r($result);
deleteRecordset()
Delete recordset
Parameters
zone_idstring
required- DNS Zone ID
recordset_idstring
required- DNS Recordset ID
Example
<?phpuse ByCloud\SDK\ByCloud;$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);$result = $client->dns->deleteRecordset(['zone_id' => '550e8400-e29b-41d4-a716-446655440000','recordset_id' => '550e8400-e29b-41d4-a716-446655440000']);print_r($result);