How to connect your domain to Minecraft using SRV records
Do you have a Minecraft server you'd like to link to your domain, but your Minecraft server runs on a different IP address from your web server or on a non-standard port? No problem! Here at Porkbun, we make it easy, so you can worry about more important things (like hunting zombies).
To get started, you'll need to know the IP address and port number of your Minecraft server, and you'll need to think of a subdomain to be the secret (or not) hostname of your server (e.g. play.yourdomain.com).
(You can skip this step if you've already been provided a hostname by your Minecraft server provider and use it in step 4 instead.)
Now you will need to tell the Internet about where your domain's Minecraft server is located. We do this with an SRV record. SRV records are special records with unusual, standardized hostnames that the Minecraft client looks for when a user tries to connect to your root domain.
SRV records tell the Minecraft client: "Hey, are you looking for a Minecraft server on this domain? I'll tell you the exact hostname and port to connect to instead of the web server."
- Weight refers to the priority of your SRV record if you have more than one, so you can almost always just specify 0, or any number.
- Port refers to the TCP port on which your Minecraft server runs. 25565 is a common value, but it will need to match your Minecraft server configuration.
- Target refers to the hostname we created in step 3 that points at the IP address of your web host.
That's it! You should now be able to connect to your Minecraft server just by specifying your root domain in the Minecraft client. For more information, check out this excellent article: https://www.mcmiddleearth.com/community/wiki/setting-up-a-srv-record/