SRV record = Service Record
Supposedly you have a FiveM game server and you want to use a example.com address, you can do this by means of an A record and an SRV record. But how is the structure of this and how do you set it up?
The SRV record must contain the following elements:
- Service
- Priority
- Weight
- Port
- Target
For a FiveM server domain it will be something like this:
Service | Priority | Weight | Port | Target |
_cfx._udp | 0 | 0 | The port of your FIveM server, the default FIveM server port is 30120 | The target you want to connect to, it will define the IP of the server. If you have set the server.example.com A record it is: server.domain.com |
We have listed an example of how to setup using Cloudflare.
Cloudflare
Step 1
Through the Cloudflare domain Dashboard click on “DNS” to enter the DNS settings.
Step 2
- Click on the button “+ Add record” to drop down the new record form, Use Type : A
- In “Name” you fill in the name of your subdomain, in this example we want server.example.com so we fill in “server”.
- In “IPv4 address” you need to fill in the IP of your server.
- “TTL” can just be left at “Auto”.
- Make sure you disable Cloudflare Proxy on this record, by clicking on the orange cloud so it because “DNS only”.
- Now click on Save.
Step 3
To let FiveM know what port and what connection protocol to follow we have to setup an SRV record.
- The “Type” has to be set to SRV, you can just select this out of the list.
- In “Name” you fill in the name of your subdomain, in this example we want server.example.com so we fill in “server”.
- In “Service” you fill in “_cfx”.
- The “Protocol” must be UDP, you can just select it out of the list.
- “TLL” can just be left at “Auto”.
- In “Priority” you fill in “0”.
- In “Weight” you fill in “0”.
- In “Port” you fill in the port of your FiveM server.
- Target will be the "Name"(dot)domain.com
- Now click on Save.
Once you have set this, it will work after 2-4 hours and you can use your server.example.com address.