Get Virtualizor

Add DNS Plans

Use the Add DNS Plans to create DNS Plans on the Virtualizor panel. 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 created successfully.

For more information, you can refer this Configure PowerDNS guide.

HTTP Request

https://hostname:4085/index.php?act=adddnsplans

Parameters

NameMethodValueDescriptionRequired
actGETadddnsplansSpecified action adds a dns plan and returns true on successYes
plan_namePOSTtextUnique name of the PlanYes
dnsserveridPOSTIntID of DNS Server on which plan is to be createdYes
maxdomainsPOSTIntMaximum number of DomainsYes
maxdomainsrecPOSTIntMaximum number of Records for DomainYes
ttlPOSTIntTime To Live valueYes

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['plan_name'] = 'test';
    $post['dnsserverid'] = 10;
    $post['maxdomains'] = 1000;
    $post['maxdomainsrec'] = 1999;
    $post['ttl'] = 10000;

    $output = $admin->adddnsplan($post);

    print_r(json_encode($output));
?>

Output

{
    "title": "Add DNS Plan",
    "done": 343, //DNS plan ID
    "timenow": 1535716893,
    "time_taken": "0.207"
}
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list