Description

This function uses PTR records to add reverse DNS functionality.

 Reverse DNS lookups use PTR records to convert IP addresses into domain names.

  • 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




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




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




whmapi1 addzonerecord zone=0.168.192.in-addr.arpa name=1 ptrdname=hostname.example.com type=PTR 



{
  "metadata": {
    "version": 1,
    "reason": "Bind reloading on username using rndc zone: [0.168.192.in-addr.arpa]\n",
    "result": 1,
    "command": "addzonerecord"
  }
}




<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>



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.

hostname.example.com

Returns

This function only returns metadata.