That's the thing - you cannot run two factorio servers on the same host and have them listen on the same port. The first server that you start will bind to the port you set, and then any other process that tries to bind to that port will be denied and (if it's properly designed, like the factorio server is) will promptly give an error message and stop gracefully.ssilk wrote: ↑Sat Dec 05, 2020 8:22 amI have a question at this point: when you run two Factorio servers at one host, who or what decides which will receive which packet when the incoming packet is for the same target port? Is that be done by the operating system? I mean: there must be something “above” the two Factorio servers, which does the routing depending on the target IP, otherwise - AFAIK - the OS does not distinct between the incoming IP, it can route internally only to the port of the listening server, or not?
The SRV record solves this at the DNS level: it tells your game client what port number to connect to on the host, so that the user doesn't need to try and remember it. As mentioned above, you cannot have two factorio servers listening on host 1.2.3.4:101, you'd need to have your second server listening on host 1.2.3.4:102. Once you add a standard DNS A record, you can have that resolve to example.com:101 and example.com:102 (this already works in factorio). Once you add SRV records, you can have factorio1.example.com point to 1.2.3.4:101 for factorio clients, and factorio.example.com point to 1.2.3.4:102 for factorio clients (this does not yet work in factorio).
Another really nice feature of SRV records is that they're application specific; so you can theoretically have a website for your factorio server running on a completely different host than the game server in order to minimize game lag (ex. 4.3.2.1:80/443). You could then have a DNS A record for factorio1.example.com point to 4.3.2.1, but the SRV record for factorio would mean the game still knows to connect to the other host at 1.2.3.4:101. You'd then have the game and web browser connecting to two completely different hosts, even though you're typing in the exact same domain name for each one.