Cloudflare Subdomains
Configure Cloudflare as a DNS provider for Hydrodactyl subdomains.
Use a Cloudflare API Token, not a Global API Key. If the token is created from the wrong place or scoped to the wrong zone, subdomain creation will fail.
What You Need
- A Cloudflare-managed zone such as
example.com - A Hydrodactyl panel admin account
- A node and allocation setup that can publish a public address
- A supported egg feature such as
subdomain_minecraft
Create A Cloudflare Token
-
Open Cloudflare Dashboard -> My Profile -> API Tokens.
-
Select Create Token.
-
Start from Edit zone DNS, or create a custom token with the same scope.
-
Set the permission to:
Zone->DNS->Edit
-
Scope the token to the exact zone you want Hydrodactyl to manage:
Include->Specific zone->example.com
-
Create the token and copy it immediately.
Hydrodactyl stores the zone ID directly, so Zone Read is not required for the
normal Cloudflare subdomain flow.
Get The Zone ID
- Open the zone in Cloudflare.
- On the overview page, copy the Zone ID from the right sidebar.
Verify The Token
Before adding the domain to Hydrodactyl, verify the token from any machine that can reach the Cloudflare API:
curl "https://api.cloudflare.com/client/v4/user/tokens/verify" \
--header "Authorization: Bearer YOUR_TOKEN"The response should include "success": true.
If you receive an authentication error here, Hydrodactyl will fail too.
Create The Domain In Hydrodactyl
-
Open Admin -> Settings -> Domains.
-
Select Create Domain.
-
Fill in:
- Domain Name: your zone name, for example
example.com - DNS Provider:
Cloudflare - API Token: the token created above
- Zone ID: the Cloudflare zone ID for this domain
- Domain Name: your zone name, for example
-
Click Test Connection.
-
If the connection succeeds, save the domain.
-
Mark the domain as Active.
-
Mark it as Default if you want Hydrodactyl to generate subdomains for new supported servers automatically.
Configure The Node And Allocations
Hydrodactyl builds subdomain DNS records from the server's primary allocation. That means the address behind the allocation must be valid for public DNS.
Option 1: Publish The Allocation IP Directly
Use this if the allocation IP is already public.
- Leave Domain by Allocation Alias disabled on the node, or
- Keep it enabled only if each allocation has a correct public alias
Option 2: Publish The Allocation Alias
Use this if the node uses private addresses internally.
- Open Admin -> Nodes -> Your Node -> Settings.
- Enable Domain by Allocation Alias.
- Open Admin -> Nodes -> Your Node -> Allocation.
- Set the allocation alias for the server's primary allocation to the public IP you want DNS to publish.
If Domain by Allocation Alias is enabled and the allocation alias is blank, Hydrodactyl can create DNS records that point to the wrong address.
Record Behavior
Hydrodactyl creates different records depending on the egg feature and port:
- Minecraft on port
25565: A record only - Minecraft on a non-default port: A record plus an SRV record
- Other supported services: record sets vary by feature
See Egg Features for the supported subdomain feature flags.
Troubleshooting
Authentication error
This usually means one of the following:
- You used a Global API Key instead of an API Token
- The token is scoped to the wrong zone
- The token does not include
Zone -> DNS -> Edit - The token was copied incorrectly
Recreate the token and test it again with Cloudflare's token verify endpoint.
Subdomain Points To A Private IP
Check the node and allocation configuration:
- If Domain by Allocation Alias is enabled, make sure the allocation has a
public
ip_alias - If the alias is blank, Hydrodactyl may publish the allocation's internal IP
No Domain Appears In The Server UI
Check all of the following:
- The domain is marked Active
- The server uses an egg with a supported
subdomain_*feature - At least one domain exists in Admin -> Settings -> Domains
Automatic Subdomain Creation Does Not Happen
Automatic generation only applies when:
- The server supports subdomains
- A default domain exists
- That default domain is active