# rDNS

{% hint style="info" %}
Stacket Group complies with the RIPE NCC IPv4 PTR record guidelines, therefore our systems automatically does a DNS record check to make sure its a 1:1 mapping otherwise the request will be denied.&#x20;

If our system cannot find an A record matching the rDNS requested domain, the request will be denied with following error message "A record does not match %ipv4 address%"
{% endhint %}

## Retrieve rDNS records

<mark style="color:blue;">`GET`</mark> `https://api.suble.io/projects/:projectId/vm/:vmId/rdns`

This endpoint will respond with a list of all IPv4 addresses connected to the virtual machine along with their PTR record.

#### Path Parameters

| Name      | Type   | Description                       |
| --------- | ------ | --------------------------------- |
| projectId | string | Unique Id for the project         |
| vmId      | string | Unique Id for the virtual machine |

#### Headers

| Name          | Type   | Description               |
| ------------- | ------ | ------------------------- |
| Authorization | string | User token or project key |

{% tabs %}
{% tab title="200 " %}

```
[
    {
        "ipv4": String,
        "record": String
    }
]
```

{% endtab %}
{% endtabs %}

## Modify rDNS record

<mark style="color:green;">`POST`</mark> `https://api.suble.io/projects/:projectId/vm/:vmId/rdns`

This endpoint is used to modify a PTR record of an virtual machine ipv4 address

#### Path Parameters

| Name      | Type   | Description                       |
| --------- | ------ | --------------------------------- |
| projectId | string | Unique Id for the project         |
| vmId      | string | Unique Id for the virtual machine |

#### Request Body

| Name   | Type   | Description                                   |
| ------ | ------ | --------------------------------------------- |
| Ipv4   | string | IPv4 address of the record you want to modify |
| record | string | The domain you want the record changed to     |

{% tabs %}
{% tab title="200 " %}

```
{
    "message": String
}
```

{% endtab %}

{% tab title="400 This response will occur if you provide invalid body data or for example the domain doesn't have a matching record." %}

```
{
    "error": String
}
```

{% endtab %}
{% endtabs %}
