Page 1 of 5

Add SRV Record support

Posted: Thu Mar 10, 2016 9:44 pm
by Johannes
If a user attempts to connect to a server via a domain, their client should perform an SRV DNS record check on that domain, and if such a record is found, should use the port and srv hostname from the record as the actual connection.

So for a given foo.bar.com, the SRV check should be performed on _factorio._udp.foo.bar.com (since factorio exclusively uses UDP ports), and parse any found record for a port and host address to use during the connection.

This would make it far easier for server hosts to run multiple Factorio instances on one server and allow users to connect to them with distinct subdomains instead of having to enter port numbers.



For example, given a dedicated Linux server that has two headless Factorio games running, located at:
  • server.example.com:34197
  • server.example.com:34198
And we want to allow users to connect to these two servers without having to enter the port number by using subdomains:
  • foo.example.com
  • bar.example.com
We would create two SRV DNS records:
  • _factorio._udp.foo.example.com. <TTL> IN SRV <priority> <weight> 34197 server.example.com.
  • _factorio._udp.bar.example.com. <TTL> IN SRV <priority> <weight> 34198 server.example.com.

Minecraft's client for example has this capability: http://gaming.stackexchange.com/questions/106646 as of 1.3: http://minecraft.gamepedia.com/1.3.1#Gameplay_2 (search for "srv")

Re: Add SRV Record support

Posted: Thu Mar 10, 2016 10:57 pm
by Koub
[Koub] Merged the topics because they're merely the same.
[Edit] and superfluous post deleted :)

Re: Add SRV Record support

Posted: Thu Mar 10, 2016 11:00 pm
by Johannes
Koub wrote:[Koub] Merged the topics because they're merely the same.
Cheers, I was going to delete the other topic after I realized it would probably be better as a suggestion than a technical support question

Re: Add SRV Record support

Posted: Sun Mar 27, 2016 5:06 am
by MakCuber
Ive tried to set this up on my domain but I guess the game itself doesn't recognize SRV records yet, which is really unfortunate. I also wish they would add a server list GUI so the game remembers your favourite servers (like minecraft does kinda). Least now that I think I have the SRV record setup correctly on my domain if they ever do add support for it in the game it will already be setup :P

Re: Add SRV Record support

Posted: Sun Mar 27, 2016 1:16 pm
by skord
I'd like to totally +1 this feature request. I have a Factorio headless running in a Docker container which is linked to by another container which pulls environmental variables from the Factorio containers and automatically can create these DNS records.

In simpler terms, you start your first Factorio server and another process picks up that the server named "vanilla" has started. That other process automatically creates the A and SRV records for vanilla.factorio.example.com. If I want to spawn another server process on the same server called "bobmod", it will automatically create "bobmod.factorio.example.com". Then, the client only needs to know the DNS names, and not the port, effectively making it look as though the servers are running on separate machines.

This really comes in handy when you're playing multiple games with small groups of friends in that the servers that aren't being used are using minimal resources when people aren't connected, making it so you can run many Factorio server processes on the same box.

The ability to put a domain name instead of an ip address

Posted: Sat Apr 02, 2016 7:15 am
by domgetter
I'd love to be able to type out a domain name in the "Connect to Game" window when connecting to a multiplayer game.

As an example, assuming a headless server is running at myserver.com:

Image

Would this be possible?

Also, this is a small thing, but when my cursor is over the text input, it doesn't turn into the vertical text-insertion cursor. Would it be possible to modify it so that the cursor changes depending on where it's hovering?

Even if not, I'm loving this game and everything you've poured into it :) Thanks for the (so far) dozens of hours of fun.

Re: The ability to put a domain name instead of an ip address

Posted: Sat Apr 02, 2016 7:43 am
by domgetter
I feel this may be a duplicate of this post: viewtopic.php?f=6&t=21276&p=133660 but I'm not sure.

Re: Add SRV Record support

Posted: Sat Apr 02, 2016 10:12 am
by Koub
[Koub] : Indeed. Merged topics.

Re: The ability to put a domain name instead of an ip address

Posted: Sat Apr 02, 2016 12:26 pm
by daniel34
domgetter wrote:I'd love to be able to type out a domain name in the "Connect to Game" window when connecting to a multiplayer game.

As an example, assuming a headless server is running at myserver.com:

Image

Would this be possible?
This and the OP are two different (but similar) topics.

(1) What domgetter would like to have is already in the game. If he has a server called myserver.com and a Factorio server is running on it, clients that connect to that server by name (and port if different from 34197) will automatically look up the IP associated with it and connect correctly (called an A record). But if you are running several Factorio servers on the same hostname/IP, you need to specify a port for each server.

(2) On the other hand, SRV records as Johannes (OP) described also include the port in the record, and are not supported by Factorio right now.
Example: the server is example.com with IP 12.34.56.78 and there are two Factorio servers running on it.
With SRV it is possible to have one running with vanilla.example.com and the other with modded.example.com, without having to enter a port number although both run on the same server/IP. See the OP for more details or use Wikipedia.

Re: Add SRV Record support

Posted: Sat Apr 02, 2016 10:24 pm
by domgetter
Ah, my bad. Just tested, and it works!

Support SRV DNS

Posted: Sun Jun 05, 2016 12:40 pm
by franzmueller
merged with existing topic --daniel34

SRV would allow to host more factorio servers on the same domain without requiring players to know the exact port of the server instance.
For example a player could connect to factorio1.domain.org or factorio2.domain.org while with the current system the player would need to connect to domain.org:1234 and domain.org:4567 which is obviously less comfortable.
This works by propagating the service with DNS entrys which contain information about the service and the port (among some other information) a server offers. Some other popular Internet services like Teamspeak, Minecraft and XMPP use SRV as well, You can find out more about it on Wikipedia: https://en.wikipedia.org/wiki/SRV_record

TL;DR: SRV Support removes the need to know the port of a factorio server.

Re: Add SRV Record support

Posted: Sun Jun 05, 2016 12:52 pm
by daniel34
Friday Facts #139 - Wrapping Up Multiplayer
Starting with the upcoming 0.13 Factorio will include a multiplayer server/game browser.
FFF #139 wrote:This service greatly simplifies the game discovery and connectability. Player hosting the game (or a headless server) will simply publish the game to the Multiplayer Matching Server. This makes the game available to other players via the Browse Games Gui. This will make the clumsy connecting directly to the server pretty much obsolete (though the functionality stays).
Given this new feature I don't think that the current direct connect will be used much in the future, nor improved to add new features.

Re: Add SRV Record support

Posted: Tue Sep 06, 2016 11:35 pm
by dj4am
Johannes wrote:If a user attempts to connect to a server via a domain, their client should perform an SRV DNS record check on that domain, and if such a record is found, should use the port and srv hostname from the record as the actual connection.
Bump for show of support for SRV records. I set this up for Minecraft and it was glorious, no more explaining to anyone what a port number is or how to type it properly

Re: Add SRV Record support

Posted: Tue Sep 06, 2016 11:50 pm
by Zeblote
dj4am wrote:
Johannes wrote:If a user attempts to connect to a server via a domain, their client should perform an SRV DNS record check on that domain, and if such a record is found, should use the port and srv hostname from the record as the actual connection.
Bump for show of support for SRV records. I set this up for Minecraft and it was glorious, no more explaining to anyone what a port number is or how to type it properly
There's no need for this anymore, just use the official server list.

Re: Add SRV Record support

Posted: Wed Sep 07, 2016 2:08 pm
by ssilk
Moved to implemented.

Re: Add SRV Record support

Posted: Wed Sep 07, 2016 2:54 pm
by Mini-Me
Has the SRV support been implemented? Otherwise this move might be a bit misleading...

While I do understand that the implementation of the ingame server browser does make this feature a bit redundant, it would still be helpful for hidden (or unlisted) servers.
Factorio-Hidden.PNG
Factorio-Hidden.PNG (64.35 KiB) Viewed 33812 times

Re: Add SRV Record support

Posted: Wed Sep 07, 2016 3:10 pm
by ssilk
Maybe. I moved it back.
But to be honest I think this is very low prio, cause there is a working solution. It would be much more clever to suggest hidden or unlisted servers instead of this. :)

Re: Add SRV Record support

Posted: Wed Sep 07, 2016 3:26 pm
by Mini-Me
Yeah, I do agree that it's not a high priority task :D.
ssilk wrote:It would be much more clever to suggest hidden or unlisted servers instead of this. :)
Hmm, I don't quite understand what you mean by that. As I wanted to point with my screenshot, unlisted servers already exist :). If you choose "hidden" as visibility option, the server won't add itself to the matchmaking server.

And what I just noticed too, there actually is a way to "bookmark" a server for quick access: if you enter the address into the "Direct connection" box it will be remembered across game restarts. So if you could use a handy subdomain there instead of a port number that'd be cool :).

Re: Add SRV Record support

Posted: Wed Sep 07, 2016 4:42 pm
by ssilk
Oh, I mean something like with dropbox/google drive etc.: You create a game, then you can share a number (a link) to this game. Only those, who have that number can join.

In the same way users can watch a game: You can make a public viewing by sharing a number, that allows only public views, not playing.

Re: Add SRV Record support

Posted: Thu Nov 24, 2016 11:52 pm
by nukleus
+1 for supporting SRV records! Been using them to host minecraft servers in the past, many hosters provide easy support for them in their control centers making it easy for the general user. Being able to have a speaking name for the server ($topic.server.lan) proved useful back then (and no one could remember the port number anyways) and it'd be really awesome to have it supported in Factorio!