Get Virtualizor

Add Reverse DNS

Use Add Reverse DNS API to add new RDNS on your server.

HTTP Request

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

Parameters

NameTypeValueDescriptionRequired
actGETrdnsThe action will add rdns entryYes
rdnsPOST1/0If set then the rdns will be added.Yes
rdns_ipPOSTrdns_ipSpecify the ip address that has to be addedYes
rdns_domainPOSTrdns_domainSpecify the domain name to be added along with the IP address.Yes

Sample Code

PHP

<?php
    require_once('/usr/local/virtualizor/sdk/enduser.php');

    $key =  'your_api_key';
    $pass = 'your_api_pass';
    $ip = 'your_sedr';

    $admin = new Virtualizor_Enduser_API($ip, $key, $pass);
    $post['rdns'] = 1;
    $post['rdns_ip'] = '192.168.3.6';
    $post['rdns_domain'] = 'test_client.com';

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

    print_r(json_encode($output));  

?>

Curl

curl -k -X POST -d "addzone=1&zone_name=test234.com" -L 
"https://xcp.nuftp.com:4083/index.php?act=pdns&
api=json&apikey=your_api_key&
apipass=your_api_pass"

Output

{
    "uid": "5",
    "act": "rdns",
    "timezone": 1,
    "timenow": "October 17, 2016, 12:46 pm",
    "vpsid": "3587",
    "username": "test@test.com",
    "user_type": "2",
    "preferences": {
        "fname": "",
        "lname": "",
        "theme": "default",
        "language": "english",
        "timezone": 1
    },
    "url": "index.php?",
    "rdns": {
        "pdnsid": "1"
    },
    "pdns": {
        "pdnsid": "1"
    },
    "support_link": "http:\/\/softaculous.com",
    "disable_login_logo": 1,
    "title": "Add Reverse DNS",
    "done": {
        "msg": "The reverse DNS zone has been successfully added",
        "goto": "act=rdns"
    },
    "allowed_ip": {
        "107.189.35.165": {
            "ipid": "210417",
            "ip": "107.189.35.165",
            "ipv6": "0",
            "ipr_ips": "",
            "ipr_netmask": "",
            "vpsid": "3587",
            "hostname": "test_userapi"
        },
        "192.168.3.6": {
            "ipid": "6",
            "ip": "192.168.3.6",
            "ipv6": "0",
            "ipr_ips": "",
            "ipr_netmask": "",
            "vpsid": "3587",
            "hostname": "test_userapi"
        },
        "192.168.11.5": {
            "ipid": "7",
            "ip": "192.168.11.5",
            "ipv6": "0",
            "ipr_ips": "",
            "ipr_netmask": "",
            "vpsid": "3587",
            "hostname": "test_userapi"
        }
    },
    "rdns_records": {
        "15": {
            "id": "15",
            "domain_id": "1",
            "name": "165.35.189.107.in-addr.arpa",
            "type": "PTR",
            "content": "test123.com",
            "ttl": "86400",
            "prio": "0",
            "change_date": "1476446323",
            "ip": "107.189.35.165"
        }
    },
    "time_taken": "0.086"
}
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list