Zone Management
A DNS zone represents a domain and all its subdomains. This guide covers creating, listing, updating, and deleting zones.
Creating a Zone
Endpoint
POST /v1/dns/zones
Request
curl -X POST https://api.wayscloud.services/v1/dns/zones \
-H "Authorization: Bearer wayscloud_dns_prod_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"domain": "example.com",
"dnssec_enabled": true,
"default_ttl": 3600
}'
Parameters:
| Field | Type | Required | Description |
|---|---|---|---|
domain | string | Yes | Domain name (e.g., "example.com") |
dnssec_enabled | boolean | No | Enable DNSSEC (default: true) |
default_ttl | integer | No | Default TTL for records (default: 3600) |
Response
{
"zone_id": "zone_abc123",
"domain": "example.com",
"status": "pending",
"dnssec_enabled": true,
"default_ttl": 3600,
"nameservers": [
"grieg.wayscloud.no",
"lindgren.wayscloud.se",
"aalto.wayscloud.fi",
"bohr.wayscloud.dk"
],
"created_at": "2025-11-03T18:00:00Z",
"updated_at": "2025-11-03T18:00:00Z"
}
Fields:
zone_id- Unique zone identifier (use this for API operations)domain- Domain namestatus- Zone status:pending,active,errordnssec_enabled- Whether DNSSEC is enableddefault_ttl- Default TTL for new recordsnameservers- WAYSCloud nameservers for this zonecreated_at- Zone creation timestampupdated_at- Last update timestamp
Next Steps After Creation
-
Update your domain registrar to use WAYSCloud nameservers:
grieg.wayscloud.no
lindgren.wayscloud.se
aalto.wayscloud.fi
bohr.wayscloud.dk -
Wait for DNS propagation (usually 24-48 hours)
-
Add DNS records to your zone
-
(Optional) Enable DNSSEC at your registrar if enabled
Listing Zones
Endpoint
GET /v1/dns/zones
Request
curl -X GET https://api.wayscloud.services/v1/dns/zones \
-H "Authorization: Bearer wayscloud_dns_prod_YOUR_API_KEY"
Response
{
"zones": [
{
"zone_id": "zone_abc123",
"domain": "example.com",
"status": "active",
"dnssec_enabled": true,
"record_count": 15,
"created_at": "2025-11-03T18:00:00Z"
},
{
"zone_id": "zone_def456",
"domain": "another-domain.com",
"status": "active",
"dnssec_enabled": false,
"record_count": 8,
"created_at": "2025-11-02T14:30:00Z"
}
],
"total": 2
}
Getting Zone Details
Endpoint
GET /v1/dns/zones/{zone_id}
Request
curl -X GET https://api.wayscloud.services/v1/dns/zones/zone_abc123 \
-H "Authorization: Bearer wayscloud_dns_prod_YOUR_API_KEY"
Response
{
"zone_id": "zone_abc123",
"domain": "example.com",
"status": "active",
"dnssec_enabled": true,
"default_ttl": 3600,
"nameservers": [
"grieg.wayscloud.no",
"lindgren.wayscloud.se",
"aalto.wayscloud.fi",
"bohr.wayscloud.dk"
],
"record_count": 15,
"created_at": "2025-11-03T18:00:00Z",
"updated_at": "2025-11-04T10:15:00Z",
"ds_records": [
{
"key_tag": 12345,
"algorithm": 13,
"digest_type": 2,
"digest": "abc123def456..."
}
]
}
Updating a Zone
Endpoint
PUT /v1/dns/zones/{zone_id}
Request
curl -X PUT https://api.wayscloud.services/v1/dns/zones/zone_abc123 \
-H "Authorization: Bearer wayscloud_dns_prod_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"default_ttl": 7200
}'
Updatable Fields:
default_ttl- Default TTL for new records
DNSSEC settings cannot be changed via this endpoint. Use the DNSSEC endpoints instead.
Response
{
"zone_id": "zone_abc123",
"domain": "example.com",
"status": "active",
"dnssec_enabled": true,
"default_ttl": 7200,
"nameservers": [...],
"updated_at": "2025-11-04T12:00:00Z"
}
Deleting a Zone
Endpoint
DELETE /v1/dns/zones/{zone_id}
Request
curl -X DELETE https://api.wayscloud.services/v1/dns/zones/zone_abc123 \
-H "Authorization: Bearer wayscloud_dns_prod_YOUR_API_KEY"
Response
{
"success": true,
"message": "Zone deleted successfully",
"zone_id": "zone_abc123"
}
Deleting a zone is permanent and cannot be undone. All DNS records in the zone will be deleted.
Zone Status
Zones can have the following statuses:
| Status | Description |
|---|---|
pending | Zone created, waiting for nameserver delegation |
active | Zone is active and serving DNS queries |
error | Zone configuration error (contact support) |
suspended | Zone temporarily suspended (billing issue) |
deleting | Zone deletion in progress |
Nameservers
All WAYSCloud zones use these nameservers:
grieg.wayscloud.no # Norway - IPv4 + IPv6
lindgren.wayscloud.se # Sweden - IPv4 + IPv6
aalto.wayscloud.fi # Finland - IPv4 + IPv6
bohr.wayscloud.dk # Denmark - IPv4 + IPv6
Configure all four nameservers at your registrar for maximum redundancy.
Error Codes
| Code | Description | Resolution |
|---|---|---|
ZONE_NOT_FOUND | Zone doesn't exist | Verify zone_id |
ZONE_ALREADY_EXISTS | Domain already has a zone | Use existing zone or delete first |
INVALID_DOMAIN | Invalid domain format | Check domain name format |
QUOTA_EXCEEDED | Maximum zones reached | Delete unused zones or upgrade plan |
Best Practices
Domain Validation
Ensure domains are valid before creating zones:
import re
def is_valid_domain(domain):
"""Validate domain name format"""
pattern = r'^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}$'
return re.match(pattern, domain.lower()) is not None
# Usage
if is_valid_domain('example.com'):
create_zone('example.com')
Check Zone Status
Always check zone status before adding records:
def wait_for_zone_active(zone_id, max_wait=300):
"""Wait for zone to become active"""
import time
start = time.time()
while time.time() - start < max_wait:
zone = api.get_zone(zone_id)
if zone['status'] == 'active':
return True
time.sleep(10)
raise TimeoutError("Zone did not become active")
List Zones with Filtering
Filter zones by domain name:
zones = api.list_zones()
my_zones = [z for z in zones['zones'] if 'example' in z['domain']]
Next Steps
- Record Management - Add records to your zones
- DNSSEC - Enable DNSSEC for your zones
- Bulk Operations - Import existing zone files
- Code Examples - Complete Python/Node.js examples