VPS.org API

REST API ਡੌਕੂਮੈਂਟੇਸ਼ਨ

DNS ਪ੍ਰਬੰਧਨ API

ਆਪਣੇ ਡੋਮੇਨਾਂ ਲਈ ਪ੍ਰੋਗਰਾਮੇਟਿਕ ਤੌਰ 'ਤੇ DNS ਜ਼ੋਨ ਅਤੇ ਰਿਕਾਰਡ ਪ੍ਰਬੰਧਿਤ ਕਰੋ।

ਅੰਤਮ ਬਿੰਦੂ 4 ਅੰਤਮ ਬਿੰਦੂ
ਬੇਸ ਪਾਥ /api/v1/dns-zones
ਪ੍ਰਮਾਣਿਕਤਾ ਬੀਅਰਰ ਟੋਕਨ ਲੋੜੀਦਾ ਹੈ

ਸੰਖੇਪ ਜਾਣਕਾਰੀ

DNS API DNS ਜ਼ੋਨ ਅਤੇ ਰਿਕਾਰਡਾਂ ਦਾ ਪੂਰਾ ਪਰਬੰਧਨ ਦਿੰਦਾ ਹੈ । ਸਭ ਜ਼ੋਨ VPS.org ਦੇ ਅਧਿਕਾਰਤ ਨਾਂ ਸਰਵਰਾਂ ਉੱਤੇ ਹੋਸਟ ਕੀਤੇ ਜਾਂਦੇ ਹਨ, ਜਿਸ ਵਿੱਚ ਆਟੋਮੈਟਿਕ BIND9 ਜ਼ੋਨ ਫਾਇਲ ਨਿਰਮਾਣ ਅਤੇ ਡਿਸਪਲੇਅ ਸ਼ਾਮਲ ਹੈ ।

ਨਾਂ ਸਰਵਰ ਇੰਫਰਾਸਟਰਕਚਰ

ਮੁੱਖ ਫੀਚਰ

ਪ੍ਰਮਾਣਿਕਤਾ

ਸਭ DNS API ਮੰਗਾਂ ਲਈ ਬੀਅਰਰ ਟੋਕਨ ਪਰਮਾਣਕਿਤਾ ਦੀ ਲੋੜ ਹੈ । ਆਪਣੇ ਅਕਾਊਂਟ ਡੈਸ਼ਬੋਰਡ ਤੋਂ API ਟੋਕਨ ਬਣਾਓ /account/developers/ ਹੇਠ ਦਿੱਤੇ ਅਧਿਕਾਰਾਂ ਨਾਲ:

ਉਦਾਹਰਨ

Authorization: Bearer vps_abc123def456...
ਮਹੱਤਵਪੂਰਨ: API ਟੋਕਨ ਸਿਰਜਣ ਦੌਰਾਨ ਇੱਕ ਵਾਰ ਹੀ ਵੇਖਾਏ ਜਾਂਦੇ ਹਨ । ਉਨ੍ਹਾਂ ਨੂੰ ਸੁਰੱਖਿਅਤ ਰੱਖੋ । ਜੇਕਰ ਤੁਸੀਂ ਟੋਕਨ ਗੁਆ ਲਿਆ ਤਾਂ ਤੁਹਾਨੂੰ ਨਵਾਂ ਬਣਾਉਣਾ ਪਵੇਗਾ ।
ਪ੍ਰਾਪਤ ਕਰੋ /api/v1/dns-zones/

ਸਾਰੇ DNS ਜ਼ੋਨਾਂ ਦੀ ਸੂਚੀ ਬਣਾਓ

ਪਰਮਾਣਿਤ ਯੂਜ਼ਰ ਦੇ ਸਾਰੇ DNS ਜ਼ੋਨ ਦੀ ਪੇਜ਼ਡ ਲਿਸਟ ਪ੍ਰਾਪਤ ਕਰੋ । ਡੋਮੇਨ ਨਾਂ ਨਾਲ ਫਿਲਟਰਿੰਗ ਲਈ ਸਹਾਇਕ ਹੈ ।

ਪੁੱਛਗਿੱਛ ਪੈਰਾਮੀਟਰ

ਪੈਰਾਮੀਟਰ ਦੀ ਕਿਸਮ ਲੋੜੀਂਦਾ ਵੇਰਵਾ
domain string ਕੋਈ ਨਹੀਂ Filter zones by exact domain name (e.g., example.com)

ਉਦਾਹਰਨ ਬੇਨਤੀ

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);

ਉਦਾਹਰਨ ਜਵਾਬ

[
  {
    "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
  }
]

ਜਵਾਬ ਖੇਤਰ

ਖੇਤਰ ਦੀ ਕਿਸਮ ਵੇਰਵਾ
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

ਜਵਾਬ ਸਥਿਤੀ ਕੋਡ

200 Successfully retrieved DNS zones list
401 Unauthorized - Invalid or missing API token
403 Forbidden - Token lacks dns:list permission
ਪ੍ਰਾਪਤ ਕਰੋ /api/v1/dns-zones/{uuid}/

DNS ਜ਼ੋਨ ਵੇਰਵਾ ਲਵੋ

ਇੱਕ ਖਾਸ DNS ਜ਼ੋਨ ਬਾਰੇ ਵੇਰਵਾ ਜਾਣਕਾਰੀ ਪ੍ਰਾਪਤ ਕਰੋ, ਜਿਸ ਵਿੱਚ ਸਭ ਰਿਕਾਰਡ ਸ਼ਾਮਲ ਹਨ ।

ਮਾਰਗ ਪੈਰਾਮੀਟਰ

ਪੈਰਾਮੀਟਰ ਦੀ ਕਿਸਮ ਲੋੜੀਂਦਾ ਵੇਰਵਾ
uuid string ਹਾਂ Unique zone identifier

ਉਦਾਹਰਨ ਜਵਾਬ

{
  "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"
    }
  ]
}

ਜਵਾਬ ਸਥਿਤੀ ਕੋਡ

200 Successfully retrieved zone details
404 Zone not found or not owned by user
ਪੋਸਟ /api/v1/dns-zones/

DNS ਜ਼ੋਨ ਬਣਾਓ

ਇੱਕ ਡੋਮੇਨ ਲਈ ਇੱਕ ਨਵਾਂ DNS ਜ਼ੋਨ ਬਣਾਓ । ਜ਼ੋਨ ਤੁਰੰਤ VPS.org ਨਾਂ ਸਰਵਰਾਂ ਉੱਤੇ ਲਾਗੂ ਕੀਤਾ ਜਾਵੇਗਾ ।

ਬਾਡੀ ਪੈਰਾਮੀਟਰ ਦੀ ਬੇਨਤੀ ਕਰੋ

ਪੈਰਾਮੀਟਰ ਦੀ ਕਿਸਮ ਲੋੜੀਂਦਾ ਵੇਰਵਾ
domain string ਹਾਂ Domain name (e.g., example.com)

ਉਦਾਹਰਨ ਬੇਨਤੀ

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);

ਉਦਾਹਰਨ ਜਵਾਬ

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

ਜਵਾਬ ਸਥਿਤੀ ਕੋਡ

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

DNS ਜ਼ੋਨ ਹਟਾਓ

DNS ਜ਼ੋਨ ਅਤੇ ਸਬੰਧਤ ਸਭ ਰਿਕਾਰਡ ਹਮੇਸ਼ਾ ਲਈ ਹਟਾਓ । ਇਹ ਕਾਰਵਾਈ ਵਾਪਸ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕਦੀ ਹੈ ।

ਮਾਰਗ ਪੈਰਾਮੀਟਰ

ਪੈਰਾਮੀਟਰ ਦੀ ਕਿਸਮ ਲੋੜੀਂਦਾ ਵੇਰਵਾ
uuid string ਹਾਂ Unique zone identifier

ਜਵਾਬ ਸਥਿਤੀ ਕੋਡ

204 Zone deleted successfully (no response body)
403 Forbidden - Token lacks dns:delete permission
404 Zone not found
ਪ੍ਰਾਪਤ ਕਰੋ /api/v1/dns-zones/{uuid}/records/

ਜ਼ੋਨ ਵਿੱਚ DNS ਰਿਕਾਰਡਾਂ ਦੀ ਲਿਸਟ

ਇੱਕ ਖਾਸ ਜ਼ੋਨ (ਨੈਸਟਡ ਰੂਟ) ਲਈ ਸਭ DNS ਰਿਕਾਰਡ ਲਵੋ ।

ਮਾਰਗ ਪੈਰਾਮੀਟਰ

ਪੈਰਾਮੀਟਰ ਦੀ ਕਿਸਮ ਲੋੜੀਂਦਾ ਵੇਰਵਾ
uuid string ਹਾਂ Zone UUID

ਉਦਾਹਰਨ ਬੇਨਤੀ

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

ਉਦਾਹਰਨ ਜਵਾਬ

[
  {
    "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"
  }
]
ਪੋਸਟ /api/v1/dns-zones/{uuid}/records/

ਜ਼ੋਨ ਵਿੱਚ DNS ਰਿਕਾਰਡ ਬਣਾਓ

ਇੱਕ ਖਾਸ ਜ਼ੋਨ (ਨੈਸਟਡ ਰੂਟ) ਲਈ ਇੱਕ ਨਵਾਂ DNS ਰਿਕਾਰਡ ਸ਼ਾਮਲ ਕਰੋ ।

ਬਾਡੀ ਪੈਰਾਮੀਟਰ ਦੀ ਬੇਨਤੀ ਕਰੋ

ਪੈਰਾਮੀਟਰ ਦੀ ਕਿਸਮ ਲੋੜੀਂਦਾ ਵੇਰਵਾ
record_type string ਹਾਂ Record type: A, AAAA, CNAME, MX, TXT, NS, SRV, CAA
name string ਹਾਂ Record name (@ for root, subdomain, or FQDN)
value string ਹਾਂ 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)

ਉਦਾਹਰਨ ਬੇਨਤੀ

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())

ਜਵਾਬ ਸਥਿਤੀ ਕੋਡ

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}/

DNS ਰਿਕਾਰਡ ਪਰਬੰਧ (ਸਿੱਧਾ ਪਹੁੰਚ)

ਰਿਕਾਰਡ UUID ਦੀ ਵਰਤੋਂ ਕਰਕੇ ਵੱਖ-ਵੱਖ DNS ਰਿਕਾਰਡਾਂ ਉੱਤੇ ਪੂਰੇ CRUD ਕਾਰਵਾਈਆਂ

ਉਪਲੱਬਧ ਓਪਰੇਸ਼ਨ

ਕਿਊਰੀ ਪੈਰਾਮੀਟਰ (GET /api/v1/dns-records/ ਲਈ)

Parameter ਦੀ ਕਿਸਮ ਵੇਰਵਾ
zone string Filter records by zone UUID
record_type string Filter by record type (A, AAAA, MX, etc.)

ਉਦਾਹਰਨ: ਇੱਕ ਰਿਕਾਰਡ ਦਾ TTL ਅੱਪਡੇਟ

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

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

ਵਧੀਆ ਪ੍ਰੈਕਟੀਸ

TTL ਸੰਰਚਨਾ

ਆਮ ਪੈਟਰਨ

ਸੁਰੱਖਿਆ

ਗਲਤੀ ਹੈਂਡਲਿੰਗ

ਆਮ ਗਲਤੀਆਂ

ਸਥਿਤੀ ਕੋਡ ਗਲਤੀ ਹੱਲ਼
400 ਗਲਤ ਡੋਮੇਨ ਨਾਂ ਯਕੀਨੀ ਬਣਾਓ ਕਿ ਡੋਮੇਨ DNS ਨਾਂ ਸੰਧੀ ਦਾ ਪਾਲਣ ਕਰਦਾ ਹੈ
400 MX ਰਿਕਾਰਡ ਲਈ ਤਰਜੀਹ ਲੋੜੀਦੀ ਹੈ ਸ਼ਾਮਿਲ priority MX ਅਤੇ SRV ਰਿਕਾਰਡਾਂ ਲਈ ਖੇਤਰ
401 ਗਲਤ API ਟੋਕਨ ਚੈੱਕ ਟੋਕਨ ਫਾਰਮੈਟ (ਇਸ ਨਾਲ ਸ਼ੁਰੂ ਹੋਣਾ ਚਾਹੀਦਾ ਹੈ) vps_)
403 ਗੁੰਮ ਅਧਿਕਾਰ ਲੋੜੀਦੇ ਨਾਲ ਨਵਾਂ ਟੋਕਨ ਬਣਾਓ dns:* ਅਧਿਕਾਰ
404 ਜ਼ੋਨ/ਰੀਕਾਰਡ ਨਹੀਂ ਲੱਭਿਆ UUID ਜਾਂਚ ਕਰੋ ਅਤੇ ਇਹ ਯਕੀਨੀ ਬਣਾਓ ਕਿ ਸਰੋਤ ਤੁਹਾਡੇ ਅਕਾਊਂਟ ਨਾਲ ਸਬੰਧਤ ਹੈ

ਉਦਾਹਰਨ ਗਲਤੀ ਜਵਾਬ

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

DNS ਤਬਦੀਲੀਆਂ ਟੈਸਟ ਕੀਤੀਆਂ ਜਾ ਰਹੀਆਂ ਹਨ

ਰਿਕਾਰਡ ਪ੍ਰਸਾਰਨ ਜਾਂਚ

# 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

ਆਨਲਾਈਨ ਟੂਲ ਵਰਤੋਂ