Networking5 min read
Connecting a domain to a game server
From a bare address to play.yourdomain.com, including the port problem, and how to check it worked before you tell anybody.
A game server usually lives at an address and a port, and a domain name carries only the address. Bridging that gap is the whole task, and it has two answers depending on the game.
If the game supports SRV
Minecraft and several others will look up an SRV record, which carries the port as well as the host. Set one and players type play.example.com with no port at all. That is the tidiest result available.
If it does not
Point an A record at the address and tell people the port. play.example.com:27015 is not elegant and it is still far better than an address nobody can remember or reissue.
- Check with a DNS lookup rather than by joining; a failed join has too many possible causes.
- Lower the TTL before a planned migration, not during one.
- Keep the old address working for a few days afterwards.