![ServerSync](https://media.forgecdn.net/avatars/thumbnails/254/696/256/256/637199290945083080.png)
Hostname IP resolution on client side
raindropworks opened this issue ยท 15 comments
Serversync Version:
2.6.17
Minecraft Version:
1.12.2 (with Forge 14.23.5.2768)
Issue:
I run a modpack for a fairly small server, self hosted. Up until now every time I update mods, I put out a new modpack that has all the old mods and all the new mods. Waste a lot of time and bandwith for everyone involved. SS seems a perfect solution to almost all of those problems (especially integrating into MultiMC, which is how most play). The problem now is on my end. The server is hosted on my home network, and players connect through the 'puddle.zone' address, and works well. The IP address through the ISP is dynamic, and we have a redirect service routing that address to whatever the current IP is at the time.
Unfortunately, SS requires an ip address and can't resolve hostnames. Is there a way that in the command launching SS to pass an IP address for it to use, or a way to add hostname resolution to SS? The former might allow me to script some shenanigans to get the current IP and pass it to the jar app, or the latter could make the system more robust for all levels of users
That would be amazing. I take it there's no way to pass an IP address to the jar on launch, like the progress-only and silent flags?
Nothing that currently exists.
It would be relatively simple to add the ability to connect to a server via arguments.
I guess in the meantime I can figure out how to get a variable for the current server IP address. I'm polling my users to see what systems they're using
Is the server currently available, a tracert appears to terminate before reaching anywhere when testing against: puddle.zone
Yeah ... all I know is as expected my PC gives me one hop, because it's the same network, and trying it through Fing on my phone said puddle.zone isn't a valid domain (probably because it's one of those newer TLD's)
Using this website, it did work successfully https://ping.eu/traceroute/ ... at least it hit Beaverton, which is a big network hub for the area
hmm ... oddly enough I'm seeing a similar issue to you now. I found powershell commands to test individual ports, and I can access the SS port from inside the network, but not outside. Which is wierd, because I have the router set up to port forward
WARNING: TCP connect to (71.59.250.98 : 38067) failed
ComputerName : 71.59.250.98
RemoteAddress : 71.59.250.98
RemotePort : 38067
InterfaceAlias : vEthernet (VLAN)
SourceAddress : 192.168.1.101
PingSucceeded : True
PingReplyDetails (RTT) : 0 ms
TcpTestSucceeded : False
PS C:\Windows\System32\WindowsPowerShell\v1.0> Test-NetConnection 192.168.1.106 -Port 38067
ComputerName : 192.168.1.106
RemoteAddress : 192.168.1.106
RemotePort : 38067
InterfaceAlias : vEthernet (VLAN)
SourceAddress : 192.168.1.101
TcpTestSucceeded : True```
From a breif skim of java sockets looks like SS should already work out of the box with host names.
try {
host = InetAddress.getByName(IP_ADDRESS);
} catch (UnknownHostException e) {
Logger.error(Main.strings.getString("connection_failed_host") + ": " + IP_ADDRESS);
return false;
}
Logger.debug(Main.strings.getString("connection_attempt_server"));
clientSocket = new Socket();
Logger.log("< " + Main.strings.getString("connection_message") + " >");
try {
clientSocket.connect(new InetSocketAddress(host.getHostName(), PORT), 5000);
} catch (IOException e) {
Logger.error(Main.strings.getString("connection_failed_server") + ": " + IP_ADDRESS + ":" + PORT);
AutoClose.closeResource(clientSocket);
return false;
}
Yeah ... it is starting to seem to be a routing issue on my end may be contributing, if not the whole problem ... I'll do more digging on my end
Found the error. I fat fingered in the router. Told it to redirect to port 30867 on the server instead of 38067 ... total user/ID10T error
It works totally fine from my computer, so it should be just fine