I have two minecraft servers, on sub-domains. www.server1.example.com and www.server2.example.com. server1 is port 25565, server2 is port 25566.
When users want to connect to a non-default port in minecraft, they have to specify www.server2.example.com:25566 to connect to the server. On the default port, this is not needed, they can simply connect via www.server1.example.com.
How can I pass along which port they're connecting to on the backside of things, so that users connecting to a non-standard port only have to type in the sub domain?
Best Answer
Luckily for you, Minecraft uses SRV records when looking up servers. This allows you to specify a port for each hostname. Simply create two different SRV records in your DNS zone with different hostnames and ports:
(Note: I haven't actually used SRV myself; this is based on another page on using SRV with Minecraft.)
Note that
actual-host-server.example.com
must have anA
record; that is, it cannot be aCNAME
alias for another domain name.