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:

FieldTypeRequiredDefaultDescription
namestringYesDomain name
default_ttlintNo86400Default TTL in seconds
soa_mnamestringNons1.1bytedns.ruPrimary NS hostname
soa_rnamestringNoadmin.{name}SOA responsible email
soa_serial_autobooleanNotrueAuto-increment serial on changes
soa_refreshintNo7200SOA refresh interval
soa_retryintNo900SOA retry interval
soa_expireintNo1209600SOA expiry
soa_minimumintNo86400SOA minimum TTL
labelsobjectNo{}Key-value labels (max 64). Key: [a-z0-9_-], max 63 chars. Value: [a-z0-9_.-], max 63 chars.

On creation, the API automatically:

  1. Validates domain name
  2. Checks per-user uniqueness (a user cannot have two zones with the same name)
  3. Checks user zone limit (max 300)
  4. 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)
  5. Creates zone in database
  6. Assigns 3 NS servers and links user to zone
  7. Creates NS records at zone apex
  8. Sets verification_status: active for standard NS, pending for 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:

FieldTypeDescription
default_ttlintDefault TTL in seconds
soa_rnamestringSOA responsible email
soa_serial_autobooleanAuto-increment serial on changes
soa_refreshintSOA refresh interval
soa_retryintSOA retry interval
soa_expireintSOA expiry
soa_minimumintSOA minimum TTL
transfer_enabledbooleanEnable/disable AXFR/IXFR zone transfer
enabledbooleanEnable/disable the zone. When re-enabling, if another zone with the same name exists, verification_status becomes pending
labelsobjectFull replace of zone labels
ixfr_enabledbooleanEnable/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