Use the Edit DNS Records API to update a DNS record on the PowerDNS server.
HTTP Request
https://hostname:4085/index.php?act=add_dnsrecord&pdnsid=PDNSID&edit=DNSID
Parameters
Name | Method | Value | Description | Required |
---|---|---|---|---|
act | GET | add_dnsrecord | The action will allow to edit the dns record | Yes |
pdnsid | GET | Int | The ID of the PDNS Server which has the record | Yes |
edit | GET | Int | The ID of the DNS record to be edited | Yes |
host | POST | text | The hostname of the dns record | Yes |
content | POST | text | The content of the dns record | Yes |
prio | POST | Int | The priority of the dns record | No |
ttl | POST | Int | The value for which the record will be active | 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['pdnsid'] = 6;
$post['edit'] = 3 ;
$post['host'] = '35.189.107.in-addr.arpa';
$post['content'] = '4.2.2.2';
$post['ttl'] = 90000;
$output = $admin->edit_dnsrecord($post);
print_r(json_encode($output));
?>
Output
{
"title": "Virtualizor",
"timenow": "1480924964",
"time_taken": "0.166"
}