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.

  • 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 '19 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 '19 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 '19 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 '19 at 7:05

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.

| improve this answer | |
  • 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 '19 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 '19 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 '19 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 '19 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 '19 at 15:37

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.

| improve this answer | |

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