Multiple game server instances linked to different subdomains


#1

I’m trying to link a game (Ark) running 4 different instances to separate subdomains. The records are as such:

  • “A” record for example.com, pointing to the server IP correctly
  • 4 CNAME with ark[1-4] pointing to example.com
  • 4 SRV with _ark._tcp.ark[1-4]., 1 1 [27015-27021] ark[1-4].example.com.

Whenever I try to connect to any of the subdomains, they resolve to the default port for the game, which is 27015. Is there something I’m missing here? I disabled cloudflare’s extra protection on the subdomains because it was resolving to cloudflare’s dns ip.


#2

So basically your problem is your game client always takes the first SRV record and ignores the other three?

Your SRV records seem a bit off, as I’d assume their names should rather all be the same _ark._tcp.example.com but as I am not familiar with the software at all I cant tell for sure what it expects. So, assuming everything is correct, it should probably work and if it doesnt it is a question better for the game developers or a community dedicated to that game than here I am afraid.


#3

Thanks for the reply sandro. I think half of my problem may be that I don’t quite understand entirely what the SRV records want, it’s my first time messing with dns records. I can connect fine if I try example.com:27015, example.com:27017, etc. and I’m under the presumption the SRV record is similar to a reverse proxy server:

Connect with ark1.example.com = resolve to example.com:27015
Connect with ark2.example.com = resolve to example.com:27017

I haven’t found an example online with DNS records specifying a server cluster from the same game, different ports, mapped to subdomains. I tried using the same “name” label for all 4 SRV records but that resulted in the same issue as before.


#4

So my problem, one of my problems with this method is that I thought I could use any made up service name, and of course I cannot. For others with this problem, here is a list of services.

Perhaps I can tackle this by using a subdomain pointed towards a directory and reroute that way.


#5

An SRV record is a bit like a CNAME on steroids. Additionally to specifying a hostname it also provides a port number and specifies a service name. When you then connect you dont specify a specific host but the client takes the domain, queries its SRV records, filters by the appropriate service name, and picks a host to connect to.

https://en.wikipedia.org/wiki/SRV_record provides a good overview about SRV records and https://www.pair.com/support/kb/what-is-an-srv-record/ also comes with a nice technical description.

You cant randomly pick service names, they have the be supported by the client application, just like SRV records in general. It is probably best to continue that discussion in a forum dedicated to that game though.


#6

Thanks sandro for the answers!


closed #7

This topic was automatically closed after 31 days. New replies are no longer allowed.