Edit DNS Plan

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

NameMethodValueDescriptionRequired
actGETeditdnsplansThe action will edit the dns plansYes
dnsplidPOSTIntThe dns plan ID which needs to be editedYes
plan_namePOSTtextThe plan name which will be assignedYes
dnsserveridPOSTIntAssigning the dns serverYes
maxdomainsPOSTIntThe max domains that can be supportedYes
maxdomainsrecPOSTIntThe max domain records that can be assignedYes
ttlPOSTIntValue of Time to liveYes

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"
}
Was this helpful to you?