Set reverse DNS
POST/api/v1/vps/{vps_uuid}/ptr
Sets the reverse DNS of the IPv4 address and of the first IPv6 address. An empty hostname goes back to the default name. Names under our own domains are not accepted.
Parameters
| Name | In | Description |
|---|---|---|
| vps_uuid | path, stringrequired | VPS id, from Create a VPS or List VPS |
Request body
| Field | Type | Description |
|---|---|---|
| hostname | string, optional | PTR target, e.g. mail.example.com. Empty resets to the default name. |
Example request
curl -X POST "https://platform.serverscamp.com/api/v1/vps/$VPS_UUID/ptr" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"hostname": "mail.example.com"
}'import os, requests
token = os.environ["API_TOKEN"]
vps_uuid = "12d46f8c-d66e-4163-99aa-1245d5b06e5b"
r = requests.post(
f"https://platform.serverscamp.com/api/v1/vps/{vps_uuid}/ptr",
headers={"Authorization": f"Bearer {token}"},
json={
"hostname": "mail.example.com"
},
)
r.raise_for_status()
print(r.json())const vpsUuid = '12d46f8c-d66e-4163-99aa-1245d5b06e5b';
const r = await fetch(`https://platform.serverscamp.com/api/v1/vps/${vpsUuid}/ptr`, {
method: 'POST',
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());curl -X POST "https://platform.serverscamp.com/api/v1/vps/$VPS_UUID/ptr" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"hostname": ""
}'import os, requests
token = os.environ["API_TOKEN"]
vps_uuid = "12d46f8c-d66e-4163-99aa-1245d5b06e5b"
r = requests.post(
f"https://platform.serverscamp.com/api/v1/vps/{vps_uuid}/ptr",
headers={"Authorization": f"Bearer {token}"},
json={
"hostname": ""
},
)
r.raise_for_status()
print(r.json())const vpsUuid = '12d46f8c-d66e-4163-99aa-1245d5b06e5b';
const r = await fetch(`https://platform.serverscamp.com/api/v1/vps/${vpsUuid}/ptr`, {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.API_TOKEN}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
"hostname": ""
}),
});
console.log(r.status, await r.json());Answer
Status 200 with this body.
| Field | Type | Description |
|---|---|---|
| vps_uuid | stringrequired | |
| ptr | string, optional | Reverse DNS name now |
| custom | boolean, optional | Set by you, not the default name |
{
"vps_uuid": "12d46f8c-d66e-4163-99aa-1245d5b06e5b",
"ptr": "mail.example.com",
"custom": true
}Errors
| Status | When |
|---|---|
400 | Not a hostname, or a name under our domains |
401 | No token, or a token that is not valid |
422 | The body or a parameter is not what the operation takes |
Every operation can also answer 401 without a valid token. All errors