# 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 registry has checked that the domain is yours.

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

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.

## 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 registry 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 registry](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.
