# Hostnames and custom domains

> Planned: a target names hostnames under its network, such as arena.my-network.g.minekube.net, and custom domains that players reach through a CNAME after the Minekube API has checked that the domain is yours.

> **Planned:**
> This page describes a design that is not built yet. Today you deploy with `mk deploy`, `mk versions` and `mk rollback`; see [Deploy a version](https://minekube.com/games/versions-and-deployments/deploy).

Players reach a network at `<network>.g.minekube.net`. The plan adds names for parts of a network, and your own domains, as Cloudflare attaches routes and custom domains to a Worker.

`vite.config.ts` already takes `hostnames` and `domains` in a target, so your configuration keeps its shape. Until they are built, `mk deploy`, `mk versions deploy` and `mk rollback` stop with `not yet supported` for a target that has them, instead of ignoring them.

## Hostnames under the network

`hostnames: ["arena"]` in a target makes `arena.<network>.g.minekube.net` an entry of the network that points to the target's selector. A player who types it lands on those servers. If another project in the network claims the same hostname, the registry refuses instead of overwriting it.

## Custom domains

The Minecraft handshake carries the hostname the player typed, so a CNAME to the network's hostname is enough. Before it routes a domain, the Minekube API checks that the domain belongs to the network, with a DNS record, as Cloudflare does. The relay then maps the domain to the network. `mk deploy` says which record to set, and turns the domain on once the check passes.

## Version URLs

Later, `<version>.<network>.g.minekube.net` reaches a server that runs exactly that version, for a preview before a rollout.

## Related

- [Connector, relay and API](https://minekube.com/guide/networks/connectivity): how relays route by hostname, in Connect.
- [Vite plugin and configuration](https://minekube.com/games/versions-and-deployments/vite-plugin): where targets are declared.
