Accessing my Minecraft server from all clients

Niels Basjes, 30 July 2021

I have two sons who really like to play Minecraft whereever they are. As a consequence we now have the game on the PC (Java), Android, PS4/PS5 and Nintendo Switch. Guess what; My sons want to play together and would like dad to join the game also.

A Java minecraft server …

So I went to the Minecraft Server download site and I downloaded and configured the server.jar on one of my machines. I have also played with alternative server implementations like Spigot and Paper which do essentially the same job.

Accessing it from a Bedrock client

Currently (2021) Minecraft exists in essentially two editions: Java and Bedrock. The Java edition is the original one that runs essentially only on Linux, Mac and Windows machines. The Bedrock edition is what you use on Phones, Tablets, Game Consoles (including Windows 10) and other devices. Not surprising; both have different client-server protocols.

To make it possible to connect the Bedrock devices to the Java server we just installed Geyser to make this possible. With this the Android clients can connect to our Java based server.

Consoles

Now consoles are special; These ONLY allow you to connect to a preconfigured list of servers : the “Featured Servers”. You cannot configure your own server to appear in this list and you also cannot remove any of the servers from that list. It is completely immutable from the player perspective.

The trick that has been widely documented to allow connecting to any Bedrock server is to inject an override into the DNS lookup of the PlayStation. This way the DNS lookup of the hostname of a preconfigured “Features Server” now returns the system you want to connect to (instead of the originally intended server).

I often see that people are told to configure an untrusted external system as the DNS for your playstation which does this. This has so many security implications that I’m NEVER going to do this.

The server IP that is then returned is the IP of an instance of Bedrock Connect which is essentially a server bookmark system that is exposed over the Bedrock Client API.

So what happens here is that all the hostnames on the “Featured Servers” list are mapped not to their real IP but to the IP of a system running BedrockConnect. So all systems on the list will result in the same BedrockConnect and there you will have a list of servers to connect to.

I found this to be a massive overkill… I have ONE server that I want to connect to.

So after understanding how the flow really works I simply picked the hostname of the server I think I’m least likely to connect to, and inserted an override for just that one.

I do realize that I can do that because I have a more extensive network setup than most people. But if you are able to run your own Minecraft server then setting up an internal DNS for all your systems should be a breeze.

Since I have a Ubiquiti Unifi setup (which runs my internal DNS) I was able to simply add a static record with the IP address of the system that runs the Geyser instance.

Essentially I only had to add this snippet to the config.gateway.json (on my cloudkey) that defines the additional hostnames served by the DNS (on my USG).

root@UniFi-CloudKey:~# cat /srv/unifi/data/sites/default/config.gateway.json

{
  "system": {
    "static-host-mapping": {
      "host-name": {
        "play.inpvp.net": { "inet": [ "10.10.10.10" ] }
      }
    }
  }
}

With this deployed my Playstation still shows the hardcoded list of servers with their original names, logos and screenshots. It is the motd (Message Of The Day) that makes it clear which is my server. Other tell tale signs are the fact that the number of people on the server is very low (always less than 3, most of the time 0) and the rediculously low ping time (usually 0 or 1 ms).