Manage DNS zones and records programmatically for your domains.
Endpoints7 endpoints
Base Path/api/v1/dns-zones
AuthenticationBearer Token Required
Overview
The DNS API provides full management of DNS zones and records. All zones are hosted on VPS.org's authoritative nameservers with automatic BIND9 zone file generation and deployment.
Nameserver Infrastructure
ns1.vps.org (38.248.6.195) - Primary master with DNSSEC inline-signing
ns2.vps.org (38.248.6.196) - Secondary slave
ns3.vps.org (38.248.6.197) - Secondary slave
Key Features
Automatic BIND9 zone file generation and deployment
Zone transfers via TSIG authentication (master-slave replication)
Support for all major DNS record types (A, AAAA, CNAME, MX, TXT, NS, SRV, CAA)
Domain name filtering and UUID-based zone identification
Nested routes for zone-specific record management
Authentication
All DNS API requests require Bearer token authentication. Generate API tokens from your account dashboard at /account/developers/ with the following permissions:
dns:list - View DNS zones and records
dns:create - Create new zones and records
dns:update - Modify existing zones and records
dns:delete - Delete zones and records
dns:* - Full DNS management access
Example
Authorization: Bearer vps_abc123def456...
Important: API tokens are shown only once during creation. Store them securely. If you lose a token, you must generate a new one.
GET/api/v1/dns-zones/
List All DNS Zones
Retrieve a paginated list of all DNS zones owned by the authenticated user. Supports filtering by domain name.
Query Parameters
Parameter
Type
Required
Description
domain
string
No
Filter zones by exact domain name (e.g., example.com)
Example Request
cURL
Python
JavaScript
curl -X GET "https://admin.vps.org/api/v1/dns-zones/" \
-H "Authorization: Bearer YOUR_API_TOKEN"
Production (stable): 3600-86400 seconds (1-24 hours)
Before migration: 300-600 seconds (5-10 minutes) - Lower TTL before planned changes
Development: 300-1800 seconds (5-30 minutes) for faster testing
Common Patterns
Root domain (@): Use A/AAAA records, not CNAME
www subdomain: Can use CNAME pointing to root or separate A record
Email (MX): Always include priority, lower number = higher priority
CNAME: Cannot coexist with other record types for same name
Security
CAA Records: Specify which CAs can issue certificates
SPF/DKIM/DMARC: Configure email authentication to prevent spoofing
Regular Audits: Review DNS records quarterly, remove unused entries
Error Handling
Common Errors
Status Code
Error
Solution
400
Invalid domain name
Ensure domain follows DNS naming conventions
400
MX record requires priority
Include priority field for MX and SRV records
401
Invalid API token
Check token format (must start with vps_)
403
Missing permission
Generate new token with required dns:* permissions
404
Zone/record not found
Verify UUID and ensure resource belongs to your account
Example Error Response
{
"detail": "MX records require a priority value",
"error_code": "validation_error",
"field": "priority"
}
Testing DNS Changes
Verify Record Propagation
# 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