Set reverse DNS
PUT/api/v1/vms/{vm_uuid}/dns/ptr
Sets the name the server's public addresses resolve back to.
Parameters
| Name | In | Description |
|---|---|---|
| vm_uuid | path, stringrequired | Server id, from Create a VM or List VMs |
Request body
| Field | Type | Description |
|---|---|---|
| hostname | stringrequired | Name the public addresses resolve back to, a full domain name |
Example request
curl -X PUT "https://platform.serverscamp.com/api/v1/vms/$VM_UUID/dns/ptr" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"hostname": "mail.example.com"
}'import os, requests
token = os.environ["API_TOKEN"]
vm_uuid = "6f1c2a9e-4b3d-4e8a-9c71-2d5e8f0a1b34"
r = requests.put(
f"https://platform.serverscamp.com/api/v1/vms/{vm_uuid}/dns/ptr",
headers={"Authorization": f"Bearer {token}"},
json={
"hostname": "mail.example.com"
},
)
r.raise_for_status()
print(r.json())const vmUuid = '6f1c2a9e-4b3d-4e8a-9c71-2d5e8f0a1b34';
const r = await fetch(`https://platform.serverscamp.com/api/v1/vms/${vmUuid}/dns/ptr`, {
method: 'PUT',
headers: { Authorization: `Bearer ${process.env.API_TOKEN}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
"hostname": "mail.example.com"
}),
});
console.log(r.status, await r.json());Answer
Status 200 with this body.
| Field | Type | Description |
|---|---|---|
| vm_uuid | stringrequired | |
| hostname | stringrequired | Reverse DNS name of the public addresses now |
{
"vm_uuid": "6f1c2a9e-4b3d-4e8a-9c71-2d5e8f0a1b34",
"hostname": "mail.example.com"
}Errors
| Status | When |
|---|---|
400 | Not a full domain name |
401 | No token, or a token that is not valid |
404 | No such server in your account |
422 | The body or a parameter is not what the operation takes |
Every operation can also answer 401 without a valid token. All errors