Zones
List Zones
curl -s "https://api.1bytedns.ru/client/v1/zones?page=1&per_page=20&name=example" \
-H "Authorization: Bearer TOKEN" | python3 -m json.tool
Query Parameters: page, per_page, name (search filter)
{
"success": true,
"result": [
{
"id": 42,
"name": "example.com",
"record_count": 15,
"labels": {"env": "production", "team": "backend"},
"enabled": true,
"verification_status": "active",
"ixfr_enabled": false,
"name_servers": ["ns1.dnsprovider.local", "ns2.dnsprovider.local", "ns3.dnsprovider.local"],
"created_on": "2024-01-15T12:00:00Z",
"modified_on": "2024-06-01T10:30:00Z"
}
],
"result_info": {"page": 1, "per_page": 20, "count": 1, "total_count": 3, "total_pages": 1},
"errors": [],
"messages": []
}
Get Zone Details
curl -s https://api.1bytedns.ru/client/v1/zones/42 \
-H "Authorization: Bearer TOKEN" | python3 -m json.tool
{
"success": true,
"result": {
"id": 42,
"name": "example.com",
"labels": {"env": "production", "team": "backend"},
"enabled": true,
"verification_status": "active",
"default_ttl": 3600,
"soa_mname": "ns1.dnsprovider.local",
"soa_rname": "admin.example.com",
"soa_serial": 2024062301,
"soa_serial_auto": true,
"soa_refresh": 7200,
"soa_retry": 900,
"soa_expire": 1209600,
"soa_minimum": 86400,
"transfer_enabled": false,
"ixfr_enabled": false,
"name_servers": ["ns1.dnsprovider.local", "ns2.dnsprovider.local", "ns3.dnsprovider.local"],
"record_count": 15,
"created_on": "2024-01-15T12:00:00Z",
"modified_on": "2024-06-01T10:30:00Z"
},
"errors": [],
"messages": []
}
Create Zone
curl -s -X POST https://api.1bytedns.ru/client/v1/zones \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "example.com",
"default_ttl": 3600,
"soa_serial_auto": true,
"soa_refresh": 7200,
"soa_retry": 900,
"soa_expire": 1209600,
"soa_minimum": 86400
}' | python3 -m json.tool
Body Parameters:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | Yes | — | Domain name |
default_ttl | int | No | 86400 | Default TTL in seconds |
soa_mname | string | No | ns1.1bytedns.ru | Primary NS hostname |
soa_rname | string | No | admin.{name} | SOA responsible email |
soa_serial_auto | boolean | No | true | Auto-increment serial on changes |
soa_refresh | int | No | 7200 | SOA refresh interval |
soa_retry | int | No | 900 | SOA retry interval |
soa_expire | int | No | 1209600 | SOA expiry |
soa_minimum | int | No | 86400 | SOA minimum TTL |
labels | object | No | {} | Key-value labels (max 64). Key: [a-z0-9_-], max 63 chars. Value: [a-z0-9_.-], max 63 chars. |
On creation, the API automatically:
- Validates domain name
- Checks per-user uniqueness (a user cannot have two zones with the same name)
- Checks user zone limit (max 300)
- Determines NS format: if no active zone with this name exists, uses standard NS (
ns1/2/3.1bytedns.ru); otherwise uses user-specific NS ({userId}.ns1/2/3.1bytedns.ru) - Creates zone in database
- Assigns 3 NS servers and links user to zone
- Creates NS records at zone apex
- Sets
verification_status:activefor standard NS,pendingfor user-specific NS
Update Zone
curl -s -X PATCH https://api.1bytedns.ru/client/v1/zones/42 \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-d '{
"default_ttl": 300,
"soa_serial_auto": false,
"transfer_enabled": true,
"enabled": false,
"labels": {"env": "staging"}
}' | python3 -m json.tool
Body Parameters:
| Field | Type | Description |
|---|---|---|
default_ttl | int | Default TTL in seconds |
soa_rname | string | SOA responsible email |
soa_serial_auto | boolean | Auto-increment serial on changes |
soa_refresh | int | SOA refresh interval |
soa_retry | int | SOA retry interval |
soa_expire | int | SOA expiry |
soa_minimum | int | SOA minimum TTL |
transfer_enabled | boolean | Enable/disable AXFR/IXFR zone transfer |
enabled | boolean | Enable/disable the zone. When re-enabling, if another zone with the same name exists, verification_status becomes pending |
labels | object | Full replace of zone labels |
ixfr_enabled | boolean | Enable/disable IXFR (incremental zone transfer). Requires transfer_enabled=true. Cannot be enabled when records are bound to address groups (error 1018). Disabling transfer_enabled automatically disables IXFR. |
Only provided fields are updated. Returns full zone detail.
Delete Zone
curl -s -X DELETE https://api.1bytedns.ru/client/v1/zones/42 \
-H "Authorization: Bearer TOKEN" | python3 -m json.tool
Zone must be empty (only auto-created NS records remain). Error 1009 if zone has user records.
{"success": true, "result": {"id": 42}, "errors": [], "messages": []}
Zone Labels
Labels are key-value pairs stored as JSONB. Max 64 labels per zone. Key: [a-z0-9_-] (max 63 chars). Value: [a-z0-9_.-] (max 63 chars). Reserved prefix dns_ cannot be used for keys.
Get Zone Labels
curl -s https://api.1bytedns.ru/client/v1/zones/42/labels \
-H "Authorization: Bearer TOKEN" | python3 -m json.tool
{
"success": true,
"result": {
"env": "production",
"team": "backend"
},
"errors": [],
"messages": []
}
Update Zone Labels (Full Replace)
curl -s -X PATCH https://api.1bytedns.ru/client/v1/zones/42/labels \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-d '{"labels": {"env": "staging", "team": "frontend"}}' | python3 -m json.tool
Passed labels completely replace existing ones. To remove a label, omit it from the request. To clear all labels, send {"labels": {}}.
Get All User Labels
curl -s https://api.1bytedns.ru/client/v1/zones/labels \
-H "Authorization: Bearer TOKEN" | python3 -m json.tool
{
"success": true,
"result": {
"keys": ["env", "team"],
"values": {
"env": ["production", "staging"],
"team": ["backend", "frontend"]
}
},
"errors": [],
"messages": []
}
Zone Transfer ACL
Manage allowed IPs for AXFR/IXFR zone transfers.
List Transfer ACL
curl -s https://api.1bytedns.ru/client/v1/zones/42/transfer_acl \
-H "Authorization: Bearer TOKEN" | python3 -m json.tool
{
"success": true,
"result": [
{"id": 1, "allowed_ip": "192.0.2.1", "created_on": "2024-01-15T12:00:00Z"}
],
"errors": [],
"messages": []
}
Add ACL Entry
curl -s -X POST https://api.1bytedns.ru/client/v1/zones/42/transfer_acl \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-d '{"allowed_ip": "198.51.100.1"}' | python3 -m json.tool
Remove ACL Entry
curl -s -X DELETE https://api.1bytedns.ru/client/v1/zones/42/transfer_acl/1 \
-H "Authorization: Bearer TOKEN" | python3 -m json.tool
Last updated: 2026-06-26