Feature · 06

Subdomains

Give a server a friendly hostname — bring your own domain, or let the panel issue one automatically through Cloudflare.

01

Two modes

Custom — you point a domain (or subdomain) you already control at the node's public IP and save it against the server. No credentials needed; you manage the DNS record.

Auto — the panel creates a DNS A record <name>.mafcloud.my.id pointing at the node's public IP via the Cloudflare API, and removes it when you delete the subdomain. The base domain is configurable with SUBDOMAIN_BASE.

Terminal
GET    /api/servers/:id/subdomain                    current
POST   /api/servers/:id/subdomain   { subdomain, type }  type: "custom" | "auto"
DELETE /api/servers/:id/subdomain                    remove
02

Operator setup (auto mode)

Auto mode needs two environment variables on the API: CLOUDFLARE_API_TOKEN (scoped to Zone.DNS:Edit for your zone) and CLOUDFLARE_ZONE_ID. Without them, auto mode returns a clear "not configured" error and custom mode still works.

03

Ports & Minecraft

The record is a plain A record to the node IP, so it resolves the host but not a non-default port. A Minecraft server on 25565 is reachable at the hostname directly; on any other port players still append :port, or you add an _minecraft._tcp SRV record pointing at the hostname and port. The port allocator is stable while the server row exists, so the value won't change between restarts.