Use the Edit DNS Plan API to update the DNS plan present on the Virtualizor panel, by passing the DNS plan ID. A DNS plan contains information about the DNS server, the number of records that the DNS server can hold, the maximum number of domains that the DNS server can have and the TTL given to the records. The API response will contain "done" as "true" if the plan is updated successfully.
For more information, you can refer this Configure PowerDNS guide.
HTTP Request
https://hostname:4085/index.php?act=editdnsplans&dnsplid=DNSPLID
Parameters
Name | Method | Value | Description | Required |
---|---|---|---|---|
act | GET | editdnsplans | The action will edit the dns plans | Yes |
dnsplid | POST | Int | The dns plan ID which needs to be edited | Yes |
plan_name | POST | text | The plan name which will be assigned | Yes |
dnsserverid | POST | Int | Assigning the dns server | Yes |
maxdomains | POST | Int | The max domains that can be supported | Yes |
maxdomainsrec | POST | Int | The max domain records that can be assigned | Yes |
ttl | POST | Int | Value of Time to live | Yes |
Sample Code
<?php
require_once('/usr/local/virtualizor/sdk/admin.php');
$key = 'your_api_key';
$pass = 'your_api_pass';
$ip = 'your_server_ip';
$admin = new Virtualizor_Admin_API($ip, $key, $pass);
$post = array();
$post['dnsplid'] = 17;
$post['plan_name'] = 'test-api-dns';
$post['dnsserverid'] = 12;
$post['maxdomains'] = 1000;
$post['maxdomainsrec'] = 1000;
$post['ttl'] = 990;
$output = $admin->edit_dnsplans($post);
print_r(json_encode($output));
?>
Output
{
"title": "Edit DNS Plan",
"done": true,
"timenow": 1535718444,
"time_taken": "0.219"
}