Page tree
Skip to end of metadata
Go to start of metadata

 

Description

This function uses PTR records to add reverse DNS functionality. Reverse DNS lookups use PTR records to convert IP addresses into domain names.

Important:

  • When you call this function, you must include the additional parameters for the selected zone record type. 
  • You must create the zone file before you call this function. For more information, read our How to Configure Reverse DNS for BIND in WHM documentation.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/addzonerecord?api.version=1&zone=0.168.192.in-addr.arpa&name=1&ptrdname=hostname.example.com&type=PTR
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/addzonerecord?api.version=1&zone=0.168.192.in-addr.arpa&name=1&ptrdname=hostname.example.com&type=PTR
 Command Line
whmapi1 addzonerecord zone=0.168.192.in-addr.arpa name=1 ptrdname=hostname.example.com type=PTR 

Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command. 
  • We introduced this functionality in cPanel & WHM version 11.52.0.8.

 Output (JSON)
{
  "metadata": {
    "version": 1,
    "reason": "Bind reloading on username using rndc zone: [0.168.192.in-addr.arpa]\n",
    "result": 1,
    "command": "addzonerecord"
  }
}
 Output (XML)
<result>
    <metadata>
        <version>1</version>
        <reason>
            Bind reloading on username using rndc zone: [0.168.192.in-addr.arpa]
        </reason>
        <result>1</result>
        <command>addzonerecord</command>
    </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample

zone

string

Required

The new reverse DNS zone's name.

A valid domain name on the server.0.168.192.in-addr.arpa
namestring

Required

The record's name.

The last octet of the record's IP address.

1
typestring

Required

The DNS record type.

For reverse DNS records, you must select PTR.

PTR
ptrdnamestring

Required

A pointer to a canonical name (CNAME).

A valid hostname.

Note:

Do not omit any necessary trailing periods. 

hostname.example.com.

Returns

This function only returns metadata.