Skip to content

DNS

Base path: /api/v1/dns

The DNS module lets you manage DNS zones, records, and dynamic DNS. Supports both authoritative mode (self-hosted DNS via PowerDNS) and proxy mode (managing records via external providers like Cloudflare).

GET /dns/zones

Returns all DNS zones for the current user.

Response fields per zone:

FieldTypeDescription
idUUIDZone identifier
zonestringDomain name (e.g., example.com)
modestringauthoritative or proxy
provider_account_idUUID?Associated provider (proxy mode)
ns_verifiedbooleanNS delegation verified
ddns_enabledbooleanDynamic DNS enabled
records_countintegerNumber of DNS records

GET /dns/zones/:id

POST /dns/zones

Body:

FieldTypeRequiredDescription
zonestringYesDomain name
modestringYesauthoritative or proxy
provider_account_idUUIDProxy mode onlyRequired for proxy mode

Authoritative mode: Creates the zone in the built-in DNS server, opens port 53 if needed, and starts NS verification polling.

Proxy mode: Validates the provider account and imports the zone from the external provider.

DELETE /dns/zones/:id

In authoritative mode, removes the zone from the DNS server and closes port 53 if no other authoritative zones remain.

POST /dns/zones/:id/sync

Re-syncs zone data from the external provider. Proxy mode only.

PATCH /dns/zones/:id/ddns

Body: { "ddns_enabled": true, "ddns_record_ids": ["record-id-1", "record-id-2"] }

GET /dns/zones/:id/records

Returns all DNS records for a zone. Delegates to the appropriate provider.

Response fields per record:

FieldTypeDescription
idstringRecord identifier
typestringA, AAAA, CNAME, MX, TXT, SRV, CAA, NS
namestringRecord name (e.g., mail.example.com)
contentstringRecord value
ttlintegerTime to live (1–86400)
priorityinteger?Required for MX and SRV
proxiedbooleanCloudflare proxy enabled

POST /dns/zones/:id/records

Body: { "type": "A", "name": "www.example.com", "content": "1.2.3.4", "ttl": 3600, "proxied": false }

Validation by type:

  • A — valid IPv4
  • AAAA — valid IPv6
  • CNAME, NS — valid hostname
  • MX — hostname + priority (0–65535) required
  • SRV — priority required
  • CAA — format "flags tag value" (e.g., "0 issue letsencrypt.org")
  • TXT — any content

PUT /dns/zones/:id/records/:recordId

DELETE /dns/zones/:id/records/:recordId

GET /dns/templates

Returns available DNS record templates.

Available templates: mail-full, mail-mx-only, expose-service, caa-letsencrypt, verify-google, verify-microsoft.

Each template includes required_variables and a records array with placeholder patterns.

POST /dns/zones/:id/apply-template

Body:

{
"template": "mail-full",
"variables": {
"domain": "example.com",
"server_ip": "1.2.3.4",
"dkim_key": "MIIBIjANBg..."
}
}

Response: Array of created records.

GET /dns/provider-accounts

POST /dns/provider-accounts

Body:

FieldTypeRequiredDescription
providerstringYescloudflare, porkbun, namecheap, or hetzner
labelstringYesDisplay name
credentialsobjectYesProvider-specific credentials

Credentials by provider:

  • Cloudflare: { "api_token": "..." }
  • Porkbun: { "apikey": "...", "secretapikey": "..." }
  • Namecheap: { "api_user": "...", "api_key": "...", "client_ip": "..." }
  • Hetzner: { "api_token": "..." }

All credentials are encrypted with AES-256-GCM before storage.

POST /dns/provider-accounts/:id/test

Response: { "connected": true }

DELETE /dns/provider-accounts/:id

POST /dns/zones/:id/verify-ns

Verifies NS delegation for an authoritative zone.

Response fields:

FieldTypeDescription
verifiedbooleanWhether NS delegation is confirmed
ns_foundstring[]Nameservers found
expected_ipstringExpected server IP
propagation_statusstringpending, verified, or failed

GET /dns/ddns/status — Current DDNS status

GET /dns/ddns/log?limit=50 — IP change history with updated zones

POST /dns/ddns/check-now — Force immediate IP check

GET /dns/network/public-ip — Returns { "ip": "1.2.3.4" }

GET /dns/network/port53-check — Checks port 53 accessibility from internet (UDP + TCP)

GET /dns/network/ip-type — Detects if public IP is static, dynamic, or unknown (based on 30-day DDNS history)

GET /dns/micelclaw-subdomain

Returns the user’s *.micelclaw.com subdomain status, including subdomain, instance_ip, active, and expiry.