VPS.org API

Ukufaka idokhumende

I-DNS Management API

Phatha izindawo ze-DNS futhi urekhode ngokuhlelekile izizinda zakho.

Amaphoyinti Okugcina Amaphoyinti okuphela angu-4
Indlela Eyisisekelo /api/v1/dns-zones
Ukuqinisekiswa I-Token yomuntu ophethe idingeka

Ukubuka konke

I-DNS API inikeza ukulawula okuphelele kwezindawo ze-DNS nezingxoxo. Zonke izindawo zigcinwa kumaseva wegama agunyaziwe we-VPS.org nge-BIND9 zone file generation kanye nokubekwa.

Igama lesisebenzisi

Izici ezibalulekile

Ukuqinisekiswa

Zonke izicelo ze-DNS API zidinga isiqiniseko se-Bearer token. Dala ama-API tokens kusuka kwi-akhawunti yakho ye-dashboard ku /account/developers/ ngezimvume ezilandelayo:

Isibonelo

Authorization: Bearer vps_abc123def456...
Kubalulekile: I-API tokens ibonisane kuphela uma kwenziwa. Gcina ngokuphephile. Uma ulahlekelwa yi-token, kufanele udale enye entsha.
THOLA /api/v1/dns-zones/

Bhala Zonke Izindawo Ze-DNS

Thola uhlu oluhleliwe lwazo zonke izifunda ze-DNS ezimilikiwe ngumsebenzisi oqinisekisiwe. Ixhasa ukudluliswa ngegama lendawo.

Amapharamitha Ombuzo

Amapharamitha Uhlobo Kuyadingeka Incazelo
domain string Akukho Filter zones by exact domain name (e.g., example.com)

Isicelo Sesibonelo

cURL
Python
JavaScript
curl -X GET "https://admin.vps.org/api/v1/dns-zones/" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
import requests

url = "https://admin.vps.org/api/v1/dns-zones/"
headers = {"Authorization": "Bearer YOUR_API_TOKEN"}

response = requests.get(url, headers=headers)
print(response.json())
const response = await fetch('https://admin.vps.org/api/v1/dns-zones/', {
  headers: {'Authorization': 'Bearer YOUR_API_TOKEN'}
});

const zones = await response.json();
console.log(zones);

Impendulo Yesibonelo

[
  {
    "uuid": "abc123-def456-ghi789",
    "domain": "example.com",
    "created_at": "2024-01-15T10:30:00Z",
    "record_count": 12
  },
  {
    "uuid": "xyz789-uvw456-rst123",
    "domain": "myapp.io",
    "created_at": "2024-06-20T14:15:00Z",
    "record_count": 8
  }
]

Izinkambu Zempendulo

Isigaba Uhlobo Incazelo
uuid string Unique zone identifier (used in API requests)
domain string Domain name for this DNS zone
created_at datetime Zone creation timestamp (ISO 8601 format)
record_count integer Total number of DNS records in this zone

Amakhodi Esimo Sempendulo

200 Successfully retrieved DNS zones list
401 Unauthorized - Invalid or missing API token
403 Forbidden - Token lacks dns:list permission
THOLA /api/v1/dns-zones/{uuid}/

Thola imininingwane yendawo ye-DNS

Thola ulwazi olunemininingwane mayelana nendawo ekhankanywe ye-DNS, kufaka phakathi zonke izingeniso.

Amapharamitha Endlela

Amapharamitha Uhlobo Kuyadingeka Incazelo
uuid string Yebo Unique zone identifier

Impendulo Yesibonelo

{
  "uuid": "abc123-def456-ghi789",
  "domain": "example.com",
  "created_at": "2024-01-15T10:30:00Z",
  "record_count": 5,
  "records": [
    {
      "uuid": "rec-001",
      "record_type": "A",
      "name": "@",
      "value": "192.0.2.1",
      "ttl": 3600,
      "priority": null,
      "created_at": "2024-01-15T10:30:00Z"
    },
    {
      "uuid": "rec-002",
      "record_type": "MX",
      "name": "@",
      "value": "mail.example.com",
      "ttl": 3600,
      "priority": 10,
      "created_at": "2024-01-15T10:32:00Z"
    }
  ]
}

Amakhodi Esimo Sempendulo

200 Successfully retrieved zone details
404 Zone not found or not owned by user
ISITHUTHUKO /api/v1/dns-zones/

Dala i-DNS Zone

Dala indawo entsha ye-DNS yendawo. Indawo izofakwa ngokushesha kumaseva wegama angama-VPS.org.

Cela Amapharamitha Omzimba

Amapharamitha Uhlobo Kuyadingeka Incazelo
domain string Yebo Domain name (e.g., example.com)

Isicelo Sesibonelo

cURL
Python
JavaScript
curl -X POST "https://admin.vps.org/api/v1/dns-zones/" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"domain": "newdomain.com"}'
import requests

url = "https://admin.vps.org/api/v1/dns-zones/"
headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json"
}
data = {"domain": "newdomain.com"}

response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch('https://admin.vps.org/api/v1/dns-zones/', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({domain: 'newdomain.com'})
});

const zone = await response.json();
console.log(zone);

Impendulo Yesibonelo

{
  "uuid": "new-zone-uuid",
  "domain": "newdomain.com",
  "created_at": "2026-01-18T16:45:00Z",
  "record_count": 0,
  "records": []
}

Amakhodi Esimo Sempendulo

201 DNS zone created successfully
400 Bad Request - Invalid domain name or zone already exists
403 Forbidden - Token lacks dns:create permission
SUSA /api/v1/dns-zones/{uuid}/

Cima i-DNS Zone

Cisha ngokuqinile indawo ye-DNS kanye nazo zonke izingeniso ezixhumene nazo. Lo msebenzi awukwazi ukubuyiselwa emuva.

Amapharamitha Endlela

Amapharamitha Uhlobo Kuyadingeka Incazelo
uuid string Yebo Unique zone identifier

Amakhodi Esimo Sempendulo

204 Zone deleted successfully (no response body)
403 Forbidden - Token lacks dns:delete permission
404 Zone not found
THOLA /api/v1/dns-zones/{uuid}/records/

Hlela ama-DNS Recordes ezindaweni

Thola zonke izingeniso ze-DNS zendawo ekhankanywe (uhlelo olufakwe ngaphakathi).

Amapharamitha Endlela

Amapharamitha Uhlobo Kuyadingeka Incazelo
uuid string Yebo Zone UUID

Isicelo Sesibonelo

curl -X GET "https://admin.vps.org/api/v1/dns-zones/{uuid}/records/" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Impendulo Yesibonelo

[
  {
    "uuid": "rec-001",
    "record_type": "A",
    "name": "@",
    "value": "192.0.2.1",
    "ttl": 3600,
    "priority": null,
    "created_at": "2024-01-15T10:30:00Z"
  },
  {
    "uuid": "rec-002",
    "record_type": "MX",
    "name": "@",
    "value": "mail.example.com",
    "ttl": 3600,
    "priority": 10,
    "created_at": "2024-01-15T10:32:00Z"
  }
]
ISITHUTHUKO /api/v1/dns-zones/{uuid}/records/

Dala i-DNS Record ku-Zone

Engeza isingeniso se-DNS esitsha ezindaweni ezikhethiwe (uhlelo olune-nested).

Cela Amapharamitha Omzimba

Amapharamitha Uhlobo Kuyadingeka Incazelo
record_type string Yebo Record type: A, AAAA, CNAME, MX, TXT, NS, SRV, CAA
name string Yebo Record name (@ for root, subdomain, or FQDN)
value string Yebo Record value (IP address, hostname, text)
ttl integer No Time to live in seconds (default: 3600)
priority integer For MX/SRV Priority (required for MX and SRV records)

Isicelo Sesibonelo

cURL
Python
curl -X POST "https://admin.vps.org/api/v1/dns-zones/{uuid}/records/" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "record_type": "A",
    "name": "www",
    "value": "192.0.2.1",
    "ttl": 3600
  }'
import requests

url = f"https://admin.vps.org/api/v1/dns-zones/{zone_uuid}/records/"
headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json"
}
data = {
    "record_type": "A",
    "name": "www",
    "value": "192.0.2.1",
    "ttl": 3600
}

response = requests.post(url, headers=headers, json=data)
print(response.json())

Amakhodi Esimo Sempendulo

201 DNS record created successfully
400 Bad Request - Invalid parameters or validation error (e.g., MX record missing priority)
GET PUT PATCH DELETE /api/v1/dns-records/{uuid}/

Hlela ama-DNS Records (Ukungena ngokuqondile)

Ukusebenza kwe-CRUD okuphelele ku-DNS ebhalisiwe ngayinye usebenzisa i-UUID yoshicilelo.

Ukusebenza okutholakalayo

Ipharamitha yombuzo (ye-GET /api/v1/dns-records/)

Parameter Uhlobo Incazelo
zone string Filter records by zone UUID
record_type string Filter by record type (A, AAAA, MX, etc.)

Isibonelo: Hlaziya i-TTL ye-record

curl -X PATCH "https://admin.vps.org/api/v1/dns-records/{rec-uuid}/" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"ttl": 1800}'

Supported DNS Record Types

Uhlobo Purpose Example Value Priority Required
A Maps domain to IPv4 address 192.0.2.1 Akukho
AAAA Maps domain to IPv6 address 2001:0db8::1 Akukho
CNAME Creates alias to another domain example.com Akukho
MX Mail server for domain mail.example.com Yebo
TXT Text record (SPF, DKIM, verification) v=spf1 include:_spf.google.com ~all Akukho
NS Nameserver delegation ns1.example.com Akukho
SRV Service location record 10 5060 sip.example.com Yebo
CAA Certificate authority authorization 0 issue "letsencrypt.org" Akukho

Ukusebenza okuhle

Ukumiswa kwe-TTL

Amapharamitha ajwayelekile

Ukuphepha

Ukuphatha iphutha

Iphutha elijwayelekile

Ikhodi Yesimo Iphutha Isinqumo
400 Igama lendawo engasebenziyo Qinisekisa ukuthi ikheli lilandela izivumelwano zokubiza i-DNS
400 I-MX record idinga ukuqala Qhubeka priority indawo ye-MX ne-SRV
401 I-API token engasebenziyo Qinisekisa ifomu le-token (kudingeka iqale nge vps_)
403 Igunya elilahlekile Dala i-token entsha edinga dns:* Izivumelwano
404 Indawo/irekhodi alitholakali Qinisekisa i-UUID futhi uqiniseke ukuthi isizinda siyi-akhawunti yakho

Isibonelo sephutha sesinqumo

{
  "detail": "MX records require a priority value",
  "error_code": "validation_error",
  "field": "priority"
}

Ukuhlolwa kwe DNS

Qinisekisa ukusakazwa kwerekhodi

# Query A record
dig example.com A

# Query specific nameserver
dig @ns1.vps.org example.com

# Query MX records
dig example.com MX

# Check all records
dig example.com ANY

Sebenzisa amathuluzi e-inthanethi