How to connect your server to a domain managed by Cloudflare:
Before we start you will need a domain. You can purchase a domain from registrars such as Cloudflare, Namecheap or GoDaddy, or Google Domains.
After you have purchased your domain, you will need to connect it to Cloudflare. We have an article on how to do this over here!
If you purchased your domain through Cloudflare, you can begin following the below steps.
Opening the Cloudflare DNS Editor:
- Head over to Cloudflare’s website and login if needed
- Select
DNS
at the top of the next page
Add an A record:
- Set the Name/Subdomain/Host to the subdomain you wish to use (e.g. play or mc), or @ if you don’t want to use a subdomain
- Set the Value/IP Address/Points To to your server IP (without the port)
If your server has a Dedicated IP (has the port 25565) you can stop here.
Add an SRV Record:
Note: The following steps are NOT RECOMMENDED. It is recommended to purchase a Dedicated IP for only $4/month. SRV records are buggy and some registrars don’t support them.
- Set the target as the sub-domain you used above, including the main domain (e.g.
play.example.com
ormc.example.com
), or to the main domain if you don’t want to use a sub-domain (e.g.example.com
) - Set the name to the sub-domain you used, for example
play
ormc
, or@
if you don’t want to use a sub-domain. - Set the protocol to
_tcp
- Set the service to
_minecraft
- Set the priority to
5
- Set the weight to
0
DNS changes can take up to 48 hours to update existing records, but new records usually show instantly.