Skip to content

Conversation

@Reidond
Copy link

@Reidond Reidond commented May 17, 2025

Hello Barotrauma team 😇

In this PR I've added support for resolving DNS SRV records when client tries to join via Direct Join and enters domain name like barotrauma.example.com.

Why this is needed? Imagine that your dedicated server is hosting game server with different port than default one (27015) for example 42069 so users have to write this barotrauma.example.com:42069 which is ugly.

DNS SRV solves this and allows to host multiple servers under same domain name.

Here are some context about it:

Reidond added 2 commits May 17, 2025 03:04
…nt to utilize it

- Implemented DnsSrvResolver class for resolving SRV records using DnsClient.
- Enhanced LidgrenEndpoint to perform SRV lookups when no port is specified.
- Added unit tests for DnsSrvResolver to verify functionality.
@Reidond Reidond changed the title Feat/add dns srv record resolution to client direct connection Add dns srv record resolution to client direct connection May 17, 2025
@Reidond Reidond changed the title Add dns srv record resolution to client direct connection Add DNS SRV record resolution to client direct connection May 17, 2025
@mygamingaccount
Copy link

Imagine that your dedicated server is hosting game server with different port than default one

I'm having a hard time imagining that. People don't normally go out of their way to make simple things such as joining a multiplayer game harder by randomly changing network addresses.

Less than 10% of Barotrauma servers are dedicated, most just use Steamworks or whatever it is Epic uses, so this feature is for a niche of the niche.

Or is this something that you would specifically use? Do you have one IP address where you want to host 10 Barotrauma servers, and need the links to be pretty too?

@jsvry
Copy link

jsvry commented Jul 1, 2025

Imagine that your dedicated server is hosting game server with different port than default one

I'm having a hard time imagining that. People don't normally go out of their way to make simple things such as joining a multiplayer game harder by randomly changing network addresses.

Less than 10% of Barotrauma servers are dedicated, most just use Steamworks or whatever it is Epic uses, so this feature is for a niche of the niche.

Or is this something that you would specifically use? Do you have one IP address where you want to host 10 Barotrauma servers, and need the links to be pretty too?

There are many reasons to implement this:

  • Dedicated server hosting companies can share IPs between servers
  • ISP modems/routers that only permit certain ports to be forwarded
  • Port conflicts, 27015 is not a unique port: https://www.speedguide.net/port.php?port=27015 (not a complete list)

@Reidond
Copy link
Author

Reidond commented Jul 7, 2025

@mygamingaccount
I understand this issue is niche. I have one server for dedicated games I play and there is possibility that some port could be different from defaults ones that game might use. Originally I found this from Factorio game, and it seemed like cool feature to give my friends {game}.example.com instead of ip adress or domain.com:port

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants