Prerequisites
To be able to point a custom domain to your FiveM server, you must first own a domain. We recommend using our domain registrar at: https://cloudnord.net/domain-names to do this, but there are plenty other alternatives online. In this guide, we will go over using CloudFlare to use a custom domain in FiveM - the process is roughly the same for all hosts!
Guide using Cloudflare
- First, create an account on Cloudflare
- Add the site to Cloudflare by following this guide: https://developers.cloudflare.com/fundamentals/get-started/setup/add-site/. The site to add is the same as the domain you just purchased.
- Head to the DNS tab on Cloudflare
- Create an A record for your subdomain:
- Press "Add Record" and select:
- Type: A
- Name: <your_subdomain> (e.g., "gta" or "fivem")
- IPv4 address: Ask staff for your server IP via ticket
- Proxy status: DNS only (grey cloud - make sure the proxy is UNTICKED)
- TTL: Auto
And then "Save". - Create an SRV record for FiveM discovery:
- Press "Add Record" and select:
- Type: SRV
- Name: *cfx.*udp.<your_subdomain>
- Priority: 0
- Weight: 5
- Port: 30120 (or your custom port)
- Target: <your_subdomain>.<yourdomain.com>
And then "Save". - Your FiveM server should be discoverable using the domain within an hour. Players can now connect using your custom domain instead of the IP address. It may take a bit of time for it to start working :)
Note: Make sure the Cloudflare proxy is disabled (grey cloud) for the A record, as FiveM requires direct access to the server IP for proper functionality.