How to set up Multiple Minecraft Servers on 1 IP

First, let’s talk about why people buy multiple IPs for different Minecraft Servers. First of all, this is because of the simplicity for the end-user to connect to their servers. Because usually, you need to connect to the server IP via the default port which is 25565, in the case of BlueServers it is different but still. This is a big advantage in terms of Quality of Life but it has a burden of operational costs to buy each IP for each server. You might say that it is not security-wise to host everything on one IP due to the vulnerability of DDoS attacks, which inevitably can lead to a crash of all the servers hosted on one IP. That’s a common case scenario if you don’t use DDoS protection from BlueServers. In this way, you can mitigate the risks. 


Don’t forget that IPv4 space is very limited nowadays which means that the price for each IP will grow further and further.


Nowadays Minecraft does not require writing ports as per se because it now supports SRV records. Thanks to it you can run multiple servers on 1 IP by redirecting a person through a correct port, for example:

srv1.bestminecraftserver.com > 192.168.1.1 port 12222

srv2.bestminecraftserver.com > 192.168.1.1 port 21844

srv3.bestminecraftserver.com > 192.168.1.1 port 27555


How to configure Minecraft SRV Record

Configuring a Minecraft record is not as complex as it might seem. Let us guide you through.


Default SRV format: 

_minecraft._tcp.name TTL class SRV priority weight port target


What does each part mean:

  1. name: the domain name you have for your servers like “srv”.
  2. TTL: time to live field, default DNS record.
  3. class: default DNS record. Important: always set as IN.
  4. priority: the priority of the target host. A bigger value is less preferred and vice versa.
  5. weight: A relative weight for records with the same priority.
  6. port: the TCP/UDP port where your Minecraft server is located.
  7. target: the hostname of the machine providing the service.



There are a few use cases that might happen with your DNS provider. He might either ask for service or for protocol. In the first case, you need to put in _minecraft and in the second use _tcp.


Alright, back to the practical example. Let’s say you need to host your server on 101.9.4.12 port 43820 how will look your zone file?


_minecraft._tcp.srv  3600 IN SRV 1 5 43820 srv1.bestminecraftserver.com srv1 IN A 101.9.4.12


Let’s explain it. It says that it points to a server named srv1.bestminecraftserver.com which runs a Minecraft server on IP 101.9.4.12 port 43820. The priority here is set to 1, weight is set to 5. 

Remember that you will not mistake hostname with CNAME because it will not work. Basically, this SRV record has quite a resemblance to a typical MX record you need to write so for experienced administrators it should be pretty straightforward. 


Conclusion

After all those manipulations you will be able to host multiple Minecraft servers on the same IP. If you few servers that have a lot of players on them, we still suggest buying separate IP for each server because it will create another step of fault tolerance for your gaming server. For other questions regarding administering the Minecraft server make sure to contact our team via LiveChat. Take care!



Blog