This repository contains a PHP client library for interacting with the Cloudns API. It allows you to manage DNS zones and records programmatically.
- Create, delete, list, and update DNS zones
- Create, delete,list, and update DNS records (add delete and update are finished)
- Get statistics of DNS zones (Soon)
- Get account Informations (Soon)
- PHP 8.0 or higher
- Composer
Install the library using Composer:
composer require qcloudns/client
require 'vendor/autoload.php';
use Qcloudns\Client;
use Qcloudns\ZoneManager;
$authId = 'your-auth-id';
$authPassword = 'your-auth-password';
$client = new Client($authId, $authPassword);
$zoneManager = new ZoneManager($client);
$recordManager = new RecordManager($client);
$response = $zoneManager->createZone('example.com');
print_r($response);
$response = $zoneManager->updateZone('example.com');
print_r($response);
$response = $zoneManager->listZones();
print_r($response);
$response = $zoneManager->listZones();
print_r($response);
$data = [
'record-type' => 'A',
'host' => 'www',
'record' => '192.0.2.1',
'ttl' => 3600,
'priority' => 10
];
$response = $recordManager->createRecord('example.com', $data);
print_r($response);
$data = [
'record-id' => 1234,
'host' => 'www',
'record' => '192.0.2.1',
'ttl' => 3600,
'priority' => 10
];
$response = $recordManager->updateRecord('example.com', $data);
print_r($response);
$response = $recordManager->getRecord(string $domain, string $recordid);
print_r($response);
$response = $recordManager->listRecords(string $domain);
print_r($response);
$response = $recordManager->deleteRecord(string $domain, string $recordid);
print_r($response);