Skip to content

DNS API

DNS zones and records

Base URL: https://api.wayscloud.services

Endpoints

MethodPathDescription
GET/v1/dns/zonesList zones
POST/v1/dns/zonesCreate zone
GET/v1/dns/zones/{zone_name}Get zone
DELETE/v1/dns/zones/{zone_name}Delete zone
GET/v1/dns/zones/{zone_name}/recordsList records
POST/v1/dns/zones/{zone_name}/recordsCreate record
PUT/v1/dns/zones/{zone_name}/records/{record_id}Update record
DELETE/v1/dns/zones/{zone_name}/records/{record_id}Delete record
POST/v1/dns/zones/{zone_name}/dnssec/activateActivate DNSSEC
DELETE/v1/dns/zones/{zone_name}/dnssecDeactivate DNSSEC
GET/v1/dns/zones/{zone_name}/statisticsGet statistics

GET /v1/dns/zones

List zones

Get all DNS zones with nameservers and record counts.

Response:

FieldTypeDescription
zonesarray
totalinteger

Example:

bash
curl https://api.wayscloud.services/v1/dns/zones \
  -H "X-API-Key: wayscloud_dns_abc12_YOUR_SECRET"

Response:

json
{
  "zones": [
    {
      "name": "example.com",
      "status": "active",
      "dnssec_enabled": true,
      "record_count": 24
    },
    {
      "name": "myapp.io",
      "status": "active",
      "dnssec_enabled": false,
      "record_count": 8
    }
  ],
  "total": 2
}

POST /v1/dns/zones

Create zone

Create a DNS zone for a domain. Update your registrar nameservers after creation.

Request Body:

FieldTypeDescription
domainstringRequired. Domain name

Example:

json
{
  "domain": "example.com"
}

Response:

FieldTypeDescription
namestring
statusstringValues: active, pending, disabled
dnssec_enabledboolean
record_countinteger
nameserversarray
created_atstring

Example:

bash
curl -X POST https://api.wayscloud.services/v1/dns/zones \
  -H "X-API-Key: wayscloud_dns_abc12_YOUR_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
  "domain": "example.com"
}'

Response:

json
{
  "name": "example.com",
  "status": "active",
  "dnssec_enabled": true,
  "record_count": 24,
  "nameservers": [
    "grieg.wayscloud.no",
    "lindgren.wayscloud.se",
    "aalto.wayscloud.fi"
    "bohr.wayscloud.dk",
  ],
  "created_at": "2024-01-10T08:00:00Z"
}

GET /v1/dns/zones/

Get zone

Get zone details: nameservers, DNSSEC status, and record count.

Response:

FieldTypeDescription
namestring
statusstringValues: active, pending, disabled
dnssec_enabledboolean
record_countinteger
nameserversarray
created_atstring

Example:

bash
curl https://api.wayscloud.services/v1/dns/zones/{zone_name} \
  -H "X-API-Key: wayscloud_dns_abc12_YOUR_SECRET"

Response:

json
{
  "name": "example.com",
  "status": "active",
  "dnssec_enabled": true,
  "record_count": 24,
  "nameservers": [
    "grieg.wayscloud.no",
    "lindgren.wayscloud.se",
    "aalto.wayscloud.fi"
    "bohr.wayscloud.dk",
  ],
  "created_at": "2024-01-10T08:00:00Z"
}

DELETE /v1/dns/zones/

Delete zone

Delete a zone and all its records permanently. Irreversible.

Response:

FieldTypeDescription
successboolean
messagestring

Example:

bash
curl -X DELETE https://api.wayscloud.services/v1/dns/zones/{zone_name} \
  -H "X-API-Key: wayscloud_dns_abc12_YOUR_SECRET"

Response:

json
{
  "success": true,
  "message": "Resource deleted successfully"
}

GET /v1/dns/zones/{zone_name}/records

List records

Get all DNS records (A, AAAA, CNAME, MX, TXT, etc.) with values and TTLs.

Response:

FieldTypeDescription
recordsarray
totalinteger

Example:

bash
curl https://api.wayscloud.services/v1/dns/zones/{zone_name}/records \
  -H "X-API-Key: wayscloud_dns_abc12_YOUR_SECRET"

Response:

json
{
  "records": [
    {
      "id": "e8f9a0b1-c2d3-4567-890a-bcdef1234567",
      "name": "@",
      "type": "A",
      "content": "185.35.202.45",
      "ttl": 3600
    },
    {
      "id": "f9a0b1c2-d3e4-5678-90ab-cdef12345678",
      "name": "www",
      "type": "CNAME",
      "content": "example.com",
      "ttl": 3600
    },
    {
      "id": "a0b1c2d3-e4f5-6789-0abc-def123456789",
      "name": "@",
      "type": "MX",
      "content": "mail.example.com",
      "ttl": 3600,
      "priority": 10
    }
  ],
  "total": 3
}

POST /v1/dns/zones/{zone_name}/records

Create record

Add a DNS record. Supported types: A, AAAA, CNAME, MX, TXT, SRV, NS, CAA. Propagates within 5 minutes.

Request Body:

FieldTypeDescription
record_typestringRequired. Values: A, AAAA, CNAME, MX, TXT, SRV, NS, CAA, PTR
hoststringRequired. Hostname
recordstringRequired. Value
ttlinteger
priorityintegerFor MX/SRV

Example:

json
{
  "record_type": "A",
  "host": "www",
  "record": "192.0.2.1",
  "ttl": 3600
}

Response:

FieldTypeDescription
idstring
namestring
typestringValues: A, AAAA, CNAME, MX, TXT, NS, SRV, CAA
contentstring
ttlinteger
priorityinteger

Example:

bash
curl -X POST https://api.wayscloud.services/v1/dns/zones/{zone_name}/records \
  -H "X-API-Key: wayscloud_dns_abc12_YOUR_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
  "record_type": "A",
  "host": "www",
  "record": "192.0.2.1",
  "ttl": 3600
}'

Response:

json
{
  "id": "e8f9a0b1-c2d3-4567-890a-bcdef1234567",
  "name": "www",
  "type": "A",
  "content": "185.35.202.45",
  "ttl": 3600,
  "priority": null
}

PUT /v1/dns/zones/{zone_name}/records/

Update record

Update record value, TTL, or priority.

Request Body:

FieldTypeDescription
hoststring
recordstring
ttlinteger
priorityinteger

Example:

json
{
  "record": "192.0.2.50",
  "ttl": 1800
}

Response:

FieldTypeDescription
idstring
namestring
typestringValues: A, AAAA, CNAME, MX, TXT, NS, SRV, CAA
contentstring
ttlinteger
priorityinteger

Example:

bash
curl -X PUT https://api.wayscloud.services/v1/dns/zones/{zone_name}/records/{record_id} \
  -H "X-API-Key: wayscloud_dns_abc12_YOUR_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
  "record": "192.0.2.50",
  "ttl": 1800
}'

Response:

json
{
  "id": "e8f9a0b1-c2d3-4567-890a-bcdef1234567",
  "name": "www",
  "type": "A",
  "content": "185.35.202.45",
  "ttl": 3600,
  "priority": null
}

DELETE /v1/dns/zones/{zone_name}/records/

Delete record

Delete a DNS record from a zone.

Response:

FieldTypeDescription
successboolean
messagestring

Example:

bash
curl -X DELETE https://api.wayscloud.services/v1/dns/zones/{zone_name}/records/{record_id} \
  -H "X-API-Key: wayscloud_dns_abc12_YOUR_SECRET"

Response:

json
{
  "success": true,
  "message": "Resource deleted successfully"
}

POST /v1/dns/zones/{zone_name}/dnssec/activate

Activate DNSSEC

Enable DNSSEC to protect against DNS spoofing. Configure returned DS records at your registrar.

Response:

FieldTypeDescription
enabledboolean
ds_recordsarray
algorithmstring

Example:

bash
curl -X POST https://api.wayscloud.services/v1/dns/zones/{zone_name}/dnssec/activate \
  -H "X-API-Key: wayscloud_dns_abc12_YOUR_SECRET"

Response:

json
{
  "enabled": true,
  "ds_records": [
    "example.com. 3600 IN DS 12345 13 2 49FD46E6C4B45C55D4AC49FD46E6C4B45C55D4AC..."
  ],
  "algorithm": "ECDSAP256SHA256"
}

DELETE /v1/dns/zones/{zone_name}/dnssec

Deactivate DNSSEC

Disable DNSSEC. Remove DS records from registrar first to avoid resolution failures.

Response:

FieldTypeDescription
successboolean
messagestring

Example:

bash
curl -X DELETE https://api.wayscloud.services/v1/dns/zones/{zone_name}/dnssec \
  -H "X-API-Key: wayscloud_dns_abc12_YOUR_SECRET"

Response:

json
{
  "success": true,
  "message": "Resource deleted successfully"
}

GET /v1/dns/zones/{zone_name}/statistics

Get statistics

Get query statistics: counts, response times, and geographic distribution.

Response:

FieldTypeDescription
queries_todayinteger
queries_this_monthinteger
top_record_typesobject
response_time_ms_avgnumber

Example:

bash
curl https://api.wayscloud.services/v1/dns/zones/{zone_name}/statistics \
  -H "X-API-Key: wayscloud_dns_abc12_YOUR_SECRET"

Response:

json
{
  "queries_today": 15420,
  "queries_this_month": 425000,
  "top_record_types": {
    "A": 8500,
    "AAAA": 4200,
    "MX": 1800,
    "TXT": 920
  },
  "response_time_ms_avg": 12.5
}


WAYSCloud AS