0

I'm starting a Minecraft server with some friends of mine. Two instances of Minecraft will be running on a Dell webserver on ports 25566 and 25565 respectively (one all the time, the other will be mostly offline). Also, we're going to run an instance of Discourse on another port.

I have the domain mchorizons.gq registered and I will use it for a website (it works, hosted with GitHub). My goal is to arrange the subdomains like this:

  • www.mchorizons.ga: Website
  • play.mchorizons.ga: 24/7 Server
  • private.mchorizons.ga: Occasional Server
  • forums.mchorizons.ga: Discourse

Cloudflare doesn't seem to support forcing a port to a subdomain. My other idea was to use a nameserver hosted somewhere that would route each incoming request to its respective port. I saw on another post that PowerDNS could be used to host a nameserver, but that had nothing on how to use it. Would it be viable to host a nameserver that manages ports to one IP?

Note: I did check this post that said I could use SRV records. I tried following the directions but to no avail.

0

2 Answers 2

2

They can always specify the port number in the URL like this:

play.mchorizons.ga:25565
or
play.mchorizons.ga:25566

It is ultimately up to the players to decide which server they're connecting to, so what difference does it make if they have to enter a different port or a different domain?

The Minecraft server uses port 25565 by default, and so does the Minecraft client. If they only specify play.mchorizons.ga then they will connect to the server listening on 25565. I would recommend that you make this the public server since it's going to be running 24/7.


There is nothing you can do on your DNS to have two subdomains pointing to the same IP but different ports. DNS only helps computers find each other by domain to IP translation. The port number is not a part of a domain name, so it cannot be considered in a domain -> IP lookup.

If you wanted to set up the servers that way you actually need either two server systems or two internet connections (IPs) on a single server. Then use port forwarding on each router/interface to route connections from that IP to a specific port number.

1
  • While true, service records can take place and force the port instead of including it in the A record. And on that note, I can't get the client to connect to the server if it's on port 25565. Oct 8, 2020 at 22:08
-1

Edit: I think I misunderstood your question, so this answer will be incorrect (see comment).

The DNS only handles resolution from domain name to the IP address, nothing else. If your server has a public IP you don't need to do any configuration (except setting the A record or AAAA record for the associated IP but nothing about the port).

If the server is e behind a NAT the standard way is to setup a port at the router forward at the router providing the NAT. (Note: using the same IP and port multiple Domain names is a different matter)

4
  • I can't route traffic through an A record either. That was the first method I tried (play.mchorizons.ga points to [Server IP without port]) Oct 8, 2020 at 20:56
  • @CStafford-14 The A record is not for routing traffic it's just to resolve the DNS name to an IP. But I think I misunderstood your question, your server is hosted by Cloudflare, right? With the Dell server, I assumed you host it yourself.
    – Albin
    Oct 8, 2020 at 21:31
  • Correct, though I have found an answer. I can disable Cloudflare's proxy and add the service records as stated in other tutorials. This does pose a security risk as the public IP of the server is now shown in ping results. Oct 8, 2020 at 22:01
  • And yes, we physically have the server in one of the member's home. Oct 8, 2020 at 22:03

You must log in to answer this question.

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