7

I have a Minecraft server running on a port different than the default one. I want to create a domain that points to the server port, but when I'm creating it, it doesn't allow me to set the IP to ip:port. I also don't want people to have to put domain.com:port.

Is there any way to solve this?
I think it has to be easy, because there are some webpages that allow you to create a subdomain pointing to a port that you can specify.

EDIT: I have found this guide that tells exactly how to do what i'm asking for. However, I got a free domain from Freenom and i think they don't give me the option to add SRV records (and I don't even know what that means). Is there any other way to do what this guide tells with Freenom domains? I really don't want to spend money on this because again, it's a very small server and I only play with some friends. I know this way i would get something like mc.domain.tk but that's ok for me.

Thanks for all the replies so far.

closed as off-topic by aytimothy, Joachim, Reflexive, Schism, Wondercricket Jul 29 at 12:24

  • This question does not appear to be about videogames or videogame consoles within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    What kind of server is this, single player opened to LAN, run from minecraft server jar or hosted on a 3rd party website? Also, are you running MC java or bedrock? – Stephen May 29 at 23:27
  • I'm using a 3rd party hosting service and running Spigot (MC java edition server). They run multiple servers on the same machine so they give a different port to each server. I don't think this helps, but they use the Multicraft control panel. I was planning to get one of these free .tk domains because it is a very small server and I don't want to spend a lot of money on it. – jnts May 30 at 5:10
  • 1
    This question actually has nothing to do with Minecraft, but instead is a general question about how the internet works. Thus, I am flagging it for closure as off-topic. – pppery Jul 28 at 3:50
  • 4
    I'm voting to close this question as off-topic because it's about networking and is not specific to gaming. Belongs on SuperUser or Webmasters, maybe? – aytimothy Jul 28 at 7:05
5

You can't. *

Domain names don't support that. They're merely a human readable alias of one or more IP addresses and cannot be linked to a specific port.

If you want your players to be able to just use the domain name without port you'll need to use the default port (for Minecraft it is 25565). The default port will always be used when a player doesn't specify a port in the game. For example: mc.example.com:25565 = mc.example.com.

Or if you have access to it you could as well redirect the default port to yours. For example with iptables. But that would only work if the default port is not in use (e.g. by another Minecraft server).

* Some providers do allow it in their control panel as a part of unmasked redirect. They then redirect the traffic from that domain using their local settings to the target ip:port. This is no common practice so I cannot tell who actually supports it.

  • Ok, that makes sense but if you have time, take a look at hosthorde.net/create . It just does what I want but with a subdomain. How can they do that? You don't even need to have a server with them, and I don't think they have access to servers from other companies to change these iptables. – jnts May 30 at 13:07
  • 1
    @jnts they probably have their own forwarding rules to redirect incoming traffic on that domain to a specific target. Certain domain providers support it and it's called unmasked redirect. I'll add that option to the answer. – dly May 30 at 14:00
  • @dly it's not HTTP so it can't be a URL redirect. It will be an internal proxy. – OrangeDog May 30 at 15:19
  • @OrangeDog it's just the name of the setting I took from my provider's control panel. Anyway, I removed the URL part. It's still a redirect though. – dly May 30 at 15:35
  • @dly so when you join an MC server using one of these services, the name changes into something else? If it doesn't then it's certainly not "unmasked" and it probably isn't a redirect either. – OrangeDog May 30 at 15:37
1

That's not how DNS works. Whatever's in the A (or AAAA) record is going to be used as an IP address only. The port is something different.

You can however achieve what you want. There are two main options.

  1. Run a proxy on the default port that forwards traffic to the actual MC server(s). For example Velocity.

  2. Run a MC server on the default port with mods that redirect players to the other server(s). For example ServerRedirect.

If what you want is a bit complicated, then you're going to need more than one machine and/or domain to solve it.

Not the answer you're looking for? Browse other questions tagged or ask your own question.