This article provides a guide for a VPS User to list DNS server info using the VPS User API.
Use List DNS Server API to get the DNS server information from your server.
HTTP Request
https://vm1.apivps.com:4083/index.php?act=pdns
Parameters
Name | Type | Value | Description | Required |
---|---|---|---|---|
act | GET | pdns | The action will add a DNS Zone | Yes |
Sample Code
PHP
<?php
require_once('/usr/local/virtualizor/sdk/enduser.php');
$key = 'your_api_key';
$pass = 'your_api_pass';
$ip = 'your_server_ip';
$admin = new Virtualizor_Enduser_API($ip, $key, $pass);
$output = $admin->pdns($id,$post);
print_r(json_encode($output));
?>
Curl
curl -k -X GET -L "https://vm1.apivps.com:4083/index.php?act=pdns
&api=json&apikey=your_api_key&
apipass=your_api_pass"
Output
{
"uid": "372",
"act": "pdns",
"timezone": 1,
"timenow": "October 12, 2023, 6:22 am",
"vpsid": "3591",
"username": "test@test.com",
"user_type": "2",
"preferences": {
"fname": "test",
"lname": "test",
"language": "english",
"theme": "default",
"timezone": 1,
"logo": ""
},
"url": "index.php?",
"rdns": {
"pdnsid": "12"
},
"pdns": {
"pdnsid": "12"
},
"support_link": "http:\/\/apivps.com",
"title": "DNS Management",
"domains": {
"3": {
"id": "3",
"name": "xx.xx.xx.in-addr.arpa",
"master": null,
"last_check": null,
"type": "NATIVE",
"notified_serial": null,
"account": null,
"virtualizor_uid": "372"
}
},
"time_taken": "0.104"
}