5

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?

I think I may need something like SRV ( http://en.wikipedia.org/wiki/SRV_record ) anyone have experience with this?

Threads with people that have this working via SRV: http://www.minecraftforum.net/topic/1434125-srv-dns-records-server/ - the guy surviveminecraft is in my same situation, and has this working.

-UPDATE/RESOLUTION -

This is how I got this working, hopefully it will help someone else in my position.

I created a subdomain sub.example.com for the secondary server running on the non-standard port. ( 25566 )

In my provided DNS manager, under my SRV settings, I applied this in the provided boxes:

_minecraft._tcp.sub priority:0 weight:5 port:25566 target:<ip address here>

'_minecraft' is just a symbolic name, 'sub' is the name of your subdomain, for example it could be '_tcp.dev' if your subdomain was dev.example.com. Once the subdomain and the SRV are linked, it should work, providing you have the correct port entered and forwarded.

More info in my blog here.

3 Answers 3

5

Looks like the Minecraft client issues fetches a SRV record upon connect and uses the info there? Interesting.

Basically you'll need an A record in DNS pointing to your server. You probably already have two of these.

And then two CNAME records naming your first and second instance. The CNAME's need to point to the name in the above A record. Your CNAMEs need to end in the same domain as the respective server, I believe.

And then two SRV records, according to this format:

_minecraft._tcp.cname.domain.tdl. outside_port IN SRV 10 5 internal_port a_record.domain.tdl.

You'd replace cname above with the CNAME's you chose, and substitute the ports in the text above accordingly.

All this needs to be done on your provider's DNS server, or through their configuration utility they may provide. Never configured a SRV record before on a publicly accessible DNS but that's what I take after reading the forum posts you provided.

2
  • Yeah, I've been testing this out now with no luck. I've got to have something wrong here. I'm still fiddling around with it. This is exactly what I need to do though. +1
    – Tillman32
    Feb 24, 2013 at 21:16
  • Almost have it working, getting a connection refused.
    – Tillman32
    Feb 25, 2013 at 4:05
1

The port is independent from DNS. This is not possible with DNS, you will need to get a second IP address in order to circumvent the need for specifying a port in Minecraft

3
  • Right, I wasn't suggesting that it was possible via DNS. I'm looking for something I can do on the backend ( On my server or router ) to direct traffic accordingly.
    – Tillman32
    Feb 24, 2013 at 19:08
  • @Tillman32: You can certainly rewrite the destination port server-side based on whatever criteria you want, but I suspect Minecraft will make indistinguishable requests to your servers. Feb 24, 2013 at 21:31
  • Yeah the port to minecraft was not what I was referencing either. SRV was what I needed.
    – Tillman32
    Feb 25, 2013 at 22:21
0

If you are looking for a way to do it without SRV Records you can use the third party software "Minecraft Redirect Proxy" https://github.com/RenegadeEagle/minecraft-redirect-proxy

The first packet that is send to a Minecraft Server includes the requested hostname. This application will inspect that packet and redirect all trafic to the user configured Minecraft Server by the requested hostname.

(See this answer for reference and an example: https://superuser.com/a/1695521/1652996)

3
  • Welcome to Super User! Before answering an old question having an accepted answer (look for green ✓) as well as other answers ensure your answer adds something new or is otherwise helpful in relation to them. Here is a guide on How to Answer. Link only answers are not welcome and your answer seems to be a hint on a duplicate. Dec 23, 2021 at 10:16
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
    – Mureinik
    Dec 23, 2021 at 10:37
  • Changed answer to reflect all relevant information. Provided link to more detailed and more recent question/answer.
    – Ohjurot
    Dec 23, 2021 at 10:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .