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).
- 1
- Log in. You should arrive at the Domain Management screen. If you're already logged in, click on ACCOUNT in the top-right corner and select Domain Management.
- 2
- Locate your domain and click the drop-down list to the right. On the menu that appears, click the "Edit" option next to "DNS Records".
- 3
- First, you need to create a semi-secret hostname for the server itself, since you're probably running your Minecraft server on a different IP address from your web server. On the Manage DNS Records screen:
-
Type: "A - Address record"
(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.) - Host: Specify the subdomain in the Host field (e.g. play).
- Answer: Specify the IP address of your Minecraft server in the Answer field. Click the "Add" button to create the A record.
- 4
- Now 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."
On the Manage DNS Records screen, you will want to input the following: - Type: "SRV - Service record"
- Host: Under hostname, you probably just want to specify: _minecraft._tcp which maps your root domain to the specifics of the Minecraft server.
- However, you can instead make an SRV record for the subdomain if you want people to connect to the subdomain instead of your root domain, for instance: _minecraft._tcp.play maps play.yourdomain.com instead of just yourdomain.com
-
-
Specify the Weight, Port, and Target in the Answer field, in that order, separated by spaces (e.g. 0 25565 play.yourdomain.com).
- 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.
- 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.
- Specify the Priority in the Priority field. We recommend 1. Priority is similar to "weight" above, so technically the number doesn't matter. Click the "Add" button to create the SRV record.
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/