# Create and Manage a Reverse DNS Record

{% hint style="info" %}
**Notes:**

* Only contract administrators, owners, and users with **accessAndManageDns** privilege can create and manage DNS zones and DNS records via the API. You can also set User privileges in the [<mark style="color:blue;">DCD</mark>](/cloud/~/revisions/AMiYziCllTKB2y2lmONY/network-services/cloud-dns/dcd-how-tos/set-user-privileges.md).
* Sub-users can create Reverse DNS records only if the user group they belong to has access to the concerned IP block. For more information, see [<mark style="color:blue;">Add users to a group</mark>](/cloud/~/revisions/AMiYziCllTKB2y2lmONY/getting-started/basic-tutorials/manage-user-access.md#add-users-to-a-group).
* [<mark style="color:blue;">Cloud DNS API</mark>](https://api.ionos.com/docs/dns/v1/) supports both IPv4 and IPv6 addresses for Reverse DNS records.
* For more information about IPv6 configuration in the DCD see [<mark style="color:blue;">IPv6 Configuration</mark>](/cloud/~/revisions/AMiYziCllTKB2y2lmONY/network-services/ipv6.md).
  {% endhint %}

### Prerequisites

{% hint style="info" %}

* You need an IONOS Cloud account with API credentials configured with the appropriate permissions.
* Before creating a Reverse DNS record, you must create an A record for the IP address you want to use for the reverse DNS record. For more information, see [<mark style="color:blue;">Create a DNS Record</mark>](/cloud/~/revisions/AMiYziCllTKB2y2lmONY/network-services/cloud-dns/api-how-tos/create-dns-record.md).
  {% endhint %}

To create a Reverse DNS Record with [<mark style="color:blue;">Cloud DNS API</mark>](https://api.ionos.com/docs/dns/v1/), follow this step:

* Perform a POST request with name, a description of reverse DNS record (optional), and the IP.

{% hint style="info" %}
**Note:**

* The **IPv4 address** must be from a reserved IP range. To reserve an IPv4 address, in the **DCD** go to the **Menu** > **Management** > **IP Management**. Enter a name and the number of IPv4 addresses, and select a region where you want your IPv4 addresses to be reserved. Select **Reserve IP** to reserve the IPv4 address, and confirm the reservation by pressing **OK**.
* To use an **IPv6 address** for a reverse DNS record, it needs to belong to any of the **/56 IPv6** blocks assigned to the VDC and have a prefix length of **/128**, that is, **2001:db8:1234:5678::1/128** and belongs to a 2001:db8:1234:5678::/56 block. For more information, see [<mark style="color:blue;">IPv6 Configuration</mark>](/cloud/~/revisions/AMiYziCllTKB2y2lmONY/network-services/ipv6.md).
  {% endhint %}

{% hint style="success" %}
**Result:** On a successful POST request, you receive a response containing the reverse DNS record UUID, type, href, metadata, properties of your reverse DNS record, name, description, and IP address.
{% endhint %}

### Request

```bash
curl --location \  
--request POST  'https://dns.de-fra.ionos.com/reverserecords' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJraWQiO' \
--header 'Content-Type: application/json' \
--data '{
      "properties": {
        "name": "mail.example.com",
        "description": "The reverse DNS record is used for mail.example.com",
        "ip": "192.0.2.2"
  }
}'
```

### Response

**200 Successful operation**

```json
{
  "id": "e74d0d15-f567-4b7b-9069-26ee1f93bae3",
  "type": "reverserecord",
  "href": "<RESOURCE-URI>",
  "metadata": {
    "lastModifiedDate": "2022-08-21T15:52:53Z",
    "createdDate": "2022-08-21T15:52:53Z"
  },
  "properties": {
    "name": "mail.example.com",
    "description": "The reverse DNS record is used for mail.example.com",
    "ip": "192.0.2.2"
  }
}
```

## Create an IPv6 reverse DNS record

To create an IPv6 reverse DNS record, perform a POST request to the `/reverserecords` endpoint with an IPv6 address in the request body.

### Request

```bash
curl --location \
--request POST 'https://dns.de-fra.ionos.com/reverserecords' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJraWQiO' \
--header 'Content-Type: application/json' \
--data '{
      "properties": {
        "name": "mail.example.com",
        "description": "The reverse DNS record is used for mail.example.com",
        "ip": "2001:0db8::1"
  }
}'
```

### Response

**200 Successful operation**

```json
{
  "id": "e74d0d15-f567-4b7b-9069-26ee1f93bae3",
  "type": "reverserecord",
  "href": "<RESOURCE-URI>",
  "metadata": {
    "lastModifiedDate": "2022-08-21T15:52:53Z",
    "createdDate": "2022-08-21T15:52:53Z"
  },
  "properties": {
    "name": "mail.example.com",
    "description": "The reverse DNS record is used for mail.example.com",
    "ip": "2001:0db8::1"
  }
}
```

#### Response Fields

| Field                | Type   | Description                                  | Example                                             |
| -------------------- | ------ | -------------------------------------------- | --------------------------------------------------- |
| **id**               | string | UUID of the newly created reverse DNS record | 2a4428b3-dbe0-4357-9c02-609025b3a40f                |
| **createdDate**      | string | Reverse DNS record creation timestamp        | 2023-03-15T09:58:59.147746133Z                      |
| **lastModifiedDate** | string | Reverse DNS record update timestamp          | 2023-03-15T09:58:59.147746133Z                      |
| **name**             | string | Name of the reverse DNS record               | mail.example.com                                    |
| **description**      | string | Description of the reverse DNS record        | The reverse DNS record is used for mail.example.com |
| **ip**               | string | IP address of the reverse DNS record         | 192.0.2.2 or 2001:0db8::1                           |
| **type**             | string | Type of the reverse DNS record               | reverserecord                                       |
| **href**             | string | URL to the reverse DNS record                |                                                     |

## Retrieve all reverse DNS records

To retrieve all reverse DNS records, perform a GET request to the `/reverserecords` endpoint.

{% hint style="success" %}
**Result:** On a successful GET request, you receive a response containing all reverse DNS records.
{% endhint %}

### Request

```bash
curl --location 'https://dns.de-fra.ionos.com/reverserecords' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJraWQiO' \
--header 'Content-Type: application/json'
```

### Response

**200 Successful operation**

```json
{
  "type": "collection",
  "href": "<RESOURCE-URI>",
  "items": [
    {
      "id": "e74d0d15-f567-4b7b-9069-26ee1f93bae3",
      "type": "reverserecord",
      "href": "<RESOURCE-URI>",
      "metadata": {
        "lastModifiedDate": "2022-08-21T15:52:53Z",
        "createdDate": "2022-08-21T15:52:53Z"
      },
      "properties": {
        "name": "mail.example.com",
        "description": "The reverse DNS record is used for mail.example.com",
        "ip": "192.0.2.2"
      }
    }
  ],
  "offset": 0,
  "limit": 1000,
  "_links": {
    "prev": "http://PREVIOUS-PAGE-URI",
    "self": "http://THIS-PAGE-URI",
    "next": "http://NEXT-PAGE-URI"
  }
}
```

#### Response Fields

| Field                | Type   | Description                           | Example                                             |
| -------------------- | ------ | ------------------------------------- | --------------------------------------------------- |
| **id**               | string | UUID of the reverse DNS record        | 2a4428b3-dbe0-4357-9c02-609025b3a40f                |
| **createdDate**      | string | Reverse DNS record creation timestamp | 2023-03-15T09:58:59.147746133Z                      |
| **lastModifiedDate** | string | Reverse DNS record update timestamp   | 2023-03-15T09:58:59.147746133Z                      |
| **name**             | string | Name of the reverse DNS record        | mail.example.com                                    |
| **description**      | string | Description of the reverse DNS record | The reverse DNS record is used for mail.example.com |
| **ip**               | string | IP address of the reverse DNS record  | 192.0.2.2 or 2001:0db8::1                           |
| **type**             | string | Type of the reverse DNS record        | reverserecord                                       |
| **href**             | string | URL to the reverse DNS record         |                                                     |

## Retrieve a reverse DNS record

To retrieve a reverse DNS record, perform a GET request to the `/reverserecords/{id}` endpoint.

{% hint style="success" %}
**Result:** On a successful GET request, you receive a response containing the reverse DNS record UUID, type, href, metadata, and properties of your reverse DNS record, name, description, and IP.
{% endhint %}

### Request

```bash
curl -X 'GET' \
  'https://dns.de-fra.ionos.com/reverserecords/e74d0d15-f567-4b7b-9069-26ee1f93bae3' \
  --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJraWQiO' \
  -H 'accept: application/json'
```

### Response

**200 Successful operation**

```json
{
  "id": "e74d0d15-f567-4b7b-9069-26ee1f93bae3",
  "type": "reverserecord",
  "href": "<RESOURCE-URI>",
  "metadata": {
    "lastModifiedDate": "2022-08-21T15:52:53Z",
    "createdDate": "2022-08-21T15:52:53Z"
  },
  "properties": {
    "name": "mail.example.com",
    "description": "The reverse DNS record is used for mail.example.com",
    "ip": "192.0.2.2"
  }
}
```

#### Response Fields

| Field                | Type   | Description                           | Example                                             |
| -------------------- | ------ | ------------------------------------- | --------------------------------------------------- |
| **id**               | string | UUID of the reverse DNS record        | 2a4428b3-dbe0-4357-9c02-609025b3a40f                |
| **createdDate**      | string | Reverse DNS record creation timestamp | 2023-03-15T09:58:59.147746133Z                      |
| **lastModifiedDate** | string | Reverse DNS record update timestamp   | 2023-03-15T09:58:59.147746133Z                      |
| **name**             | string | Name of the reverse DNS record        | mail.example.com                                    |
| **description**      | string | Description of the reverse DNS record | The reverse DNS record is used for mail.example.com |
| **ip**               | string | IP address of the reverse DNS record  |                                                     |
| **type**             | string | Type of the reverse DNS record        | reverserecord                                       |
| **href**             | string | URL to the reverse DNS record         |                                                     |

## Modify a reverse DNS record

To modify a reverse DNS record, perform a PUT request to the `/reverserecords/{id}` endpoint.

{% hint style="success" %}
**Result:** On a successful PUT request, you receive a response containing the reverse DNS record UUID, type, href, metadata, and properties of your reverse DNS record, name, description, and IP.
{% endhint %}

### Request

```bash
curl -X 'PUT' \
  'https://dns.de-fra.ionos.com/reverserecords/e74d0d15-f567-4b7b-9069-26ee1f93bae3' \
  --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJraWQiO' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "properties": {
    "name": "mail.example.com",
    "description": "The reverse DNS record is used for mail.example.com",
    "ip": "192.0.2.3"
  }
}'
```

### Response

**200 Successful operation**

```json
{
  "id": "e74d0d15-f567-4b7b-9069-26ee1f93bae3",
  "type": "reverserecord",
  "href": "<RESOURCE-URI>",
  "metadata": {
    "lastModifiedDate": "2022-08-21T15:52:53Z",
    "createdDate": "2022-08-21T15:52:53Z"
  },
  "properties": {
    "name": "mail.example.com",
    "description": "The reverse DNS record is used for mail.example.com",
    "ip": "192.0.2.3"
  }
}
```

#### Response Fields

| Field                | Type   | Description                           | Example                                             |
| -------------------- | ------ | ------------------------------------- | --------------------------------------------------- |
| **id**               | string | UUID of the reverse DNS record        | 2a4428b3-dbe0-4357-9c02-609025b3a40f                |
| **createdDate**      | string | Reverse DNS record creation timestamp | 2023-03-15T09:58:59.147746133Z                      |
| **lastModifiedDate** | string | Reverse DNS record update timestamp   | 2023-03-15T09:58:59.147746133Z                      |
| **name**             | string | Name of the reverse DNS record        | mail.example.com                                    |
| **description**      | string | Description of the reverse DNS record | The reverse DNS record is used for mail.example.com |
| **ip**               | string | IP address of the reverse DNS record  | 192.0.2.3                                           |
| **type**             | string | Type of the reverse DNS record        | reverserecord                                       |
| **href**             | string | URL to the reverse DNS record         |                                                     |

## Delete a reverse DNS record

To delete a reverse DNS record, perform a DELETE request to the `/reverserecords/{id}` endpoint.

{% hint style="success" %}
**Result:** On a successful DELETE request, you receive a HTTP response **202 Successful operation**.
{% endhint %}

### Request

```bash
curl -X 'DELETE' \
  'https://dns.de-fra.ionos.com/reverserecords/e74d0d15-f567-4b7b-9069-26ee1f93bae3' \
  --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJraWQiO' \
  -H 'accept: application/json'
```

### Response

**202 Successful operation**

## Quota

To retrieve the quota of reverse DNS records, perform a GET request to the `/quota` endpoint.

{% hint style="success" %}
**Result:** On a successful GET request, you receive a response containing the quota limits and quota usage for your contract.
{% endhint %}

### Request

```bash
curl --location 'https://dns.de-fra.ionos.com/quota' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJraWQiO' \
--header 'Content-Type: application/json'
```

### Response

**200 OK**

```json
{
  "quotaLimits": {
    "records": 100000,
    "reverseRecords": 5000,
    "secondaryZones": 100000,
    "zones": 50000
  },
  "quotaUsage": {
    "records": 9,
    "reverseRecords": 1,
    "secondaryZones": 6,
    "zones": 5
  }
}
```

#### Response Fields

| Field              | Type   | Description                        | Example |
| ------------------ | ------ | ---------------------------------- | ------- |
| **records**        | string | Number of DNS records              | 100000  |
| **reverseRecords** | string | Number of reverse DNS records      | 5000    |
| **secondaryZones** | string | Number of secondary DNS zones      | 100000  |
| **zones**          | string | Number of DNS zones                | 50000   |
| **records**        | string | Number of DNS records used         | 9       |
| **reverseRecords** | string | Number of reverse DNS records used | 1       |
| **secondaryZones** | string | Number of secondary DNS zones used | 6       |
| **zones**          | string | Number of DNS zones used           | 5       |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ionos.com/cloud/~/revisions/AMiYziCllTKB2y2lmONY/network-services/cloud-dns/api-how-tos/create-and-manage-reverse-dns.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
