Use the List DNS Plans API to list the DNS Plans present on the Virtualizor panel. A DNS plan contains information about the number of records that the DNS server can hold, the TTL given to the records and the maximum number of domains that the DNS server can have. The API response contains a list of these DNS plans listed according to their IDs. To filter or limit the size of the list, you can specify one or more query parameters.
See also : Configure PowerDNS guide.
HTTP Request
https://hostname:4085/index.php?act=dnsplans
Parameters
Name | Method | Value | Description | Required |
---|---|---|---|---|
act | GET | dnsplans | The action specified to perform operation | Yes |
reslen | GET | Int | Number of records to be returned, default is 50 | No |
page | GET | Int | Page number, each page show 50 records | No |
planname | POST | text | Search using the dns plan name | No |
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);
$page = 1;
$reslen = 10;
$post = array();
$post['planname'] = '';
$output = $admin->listdnsplans($page,$reslen,$post);
print_r(json_encode($output));
?>
Output
{
"title": "DNS Plans",
"dnsplans": {
"1": {
"dnsplid": "1",
"pdnsid": "10",
"plan_name": "test",
"max_domains": "1000",
"max_domain_records": "1999",
"def_ttl": "10000",
"dns_server_name": null
},
"2": {
"dnsplid": "2",
"pdnsid": "10",
"plan_name": "test2",
"max_domains": "1000",
"max_domain_records": "1999",
"def_ttl": "10000",
"dns_server_name": null
},
"3": {
"dnsplid": "3",
"pdnsid": "10",
"plan_name": "test3",
"max_domains": "1000",
"max_domain_records": "1999",
"def_ttl": "10000",
"dns_server_name": null
},
"4": {
"dnsplid": "4",
"pdnsid": "10",
"plan_name": "test4",
"max_domains": "1000",
"max_domain_records": "1999",
"def_ttl": "10000",
"dns_server_name": null
},
"5": {
"dnsplid": "5",
"pdnsid": "10",
"plan_name": "test5",
"max_domains": "1000",
"max_domain_records": "1999",
"def_ttl": "10000",
"dns_server_name": null
}
},
"timenow": 1535717662,
"time_taken": "0.255"
}