Quickstart
From zero to live subdomain in under 5 minutes.
Get your admin token
You need an ADMIN_TOKEN to authenticate against the API. Set it as an environment variable:
export TOKEN="your-admin-token-here"Provision a subdomain
POST a slug and target origin. The slug must be 2–63 lowercase alphanumeric characters or hyphens, and must not be on the reserved list.
curl -X POST https://xdns.wtf/api/tenants \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"slug": "myapp",
"target_origin": "https://myapp.vercel.app"
}'You'll receive:
{
"ok": true,
"fqdn": "myapp.xdns.wtf",
"target_origin": "https://myapp.vercel.app"
}Access your subdomain
Your subdomain is live immediately. All paths and query strings are preserved:
curl https://myapp.xdns.wtf/
# → proxied from https://myapp.vercel.app
# Paths and query strings work:
curl https://myapp.xdns.wtf/api/users?page=2
# → https://myapp.vercel.app/api/users?page=2The Worker adds X-XDNS-Tenant: myapp to all upstream requests so your origin can identify the routing source.
Inspect a tenant
Verify the configuration of any active tenant:
curl https://xdns.wtf/api/tenants/myapp \
-H "Authorization: Bearer $TOKEN"{
"slug": "myapp",
"target_origin": "https://myapp.vercel.app",
"subnet_id": null,
"status": "active",
"created_at": 1740600000
}Remove a subdomain
When you're done, DELETE the tenant. Routing stops immediately — no DNS flush required.
curl -X DELETE https://xdns.wtf/api/tenants/myapp \
-H "Authorization: Bearer $TOKEN"
# { "ok": true }Tips
Pass subnet_id to group tenants. The Worker sets X-XDNS-Subnet on upstream requests when a subnet is configured.
POST is idempotent — posting the same slug twice updates the target origin. No need to DELETE first.
Some slugs are reserved (www, api, docs, etc.) and will return 400 reserved_slug. See the full list in the architecture docs.
POST, PUT, PATCH, DELETE — all methods are proxied. The request body is streamed directly to the upstream origin.