Modrinth · Minecraft mod
ServerAddressSpaceFix
Fix the "unknown host" bug when adding a server or connecting directly to a server with a space at the end of the server address
Quick answer
Which ServerAddressSpaceFix release should I use?
ServerAddressSpaceFix 0.2.5 targets 26.1, 26.1.1, 26.1.2 with Fabric. It must be installed on the client. Do not install it on the dedicated server. All 1 required mods have matching files.
Where it goes
Is ServerAddressSpaceFix required on the client, server, or both?
It must be installed on the client. Do not install it on the dedicated server.
This file is marked client-only.
What else does ServerAddressSpaceFix 0.2.5 need?
0.2.5. Change the file and its required mods may change too.
Install Fabric API first. We found matching files for this game-version and loader setup. 1 comes through another mod in the chain.
1 extra mod was pulled in by another dependency. Indented rows show who needs each one. We only count dependency files that match this setup. A file for another loader does not fill the gap.
Before you install it
Add ServerAddressSpaceFix without breaking your instance.
Built for ServerAddressSpaceFix 0.2.5. Pick another file and the loader, install side or required mods may change.
- 01
Stick to this file
Use 0.2.5. It targets 26.1, 26.1.1, 26.1.2 with Fabric; another release may have different loader, side or dependency requirements.
- 02
Bring the mods it needs
Install Fabric API first. We found matching files for this game-version and loader setup. 1 comes through another mod in the chain.
- 03
Put it on the correct side
It must be installed on the client. Do not install it on the dedicated server.
- 04
Pick the file you checked
Use the “Get this file” button beside 0.2.5. It opens that exact file at the source.
About this project
What does ServerAddressSpaceFix add?
简体中文(GitHub) 简体中文(Gitea) English(GitHub) English(Gitea)
Introduction
This mod is intended to fix a bug that was reported on November 26, 2021 and still has not been fixed.
Bug tracker link
Features
If the server address you enter on the "Add Server" or "Direct Connect" screen contains spaces at the beginning, the end, or in the middle, this mod will automatically remove them.
This prevents the "Unknown Host" bug mentioned above.
Why this mod exists
A few months ago, I wanted to play on a server. I copied the address from the server's official website, pasted it into the "Server Address" field, saved it, and unexpectedly got an "Unknown Host" error.
No panic, this was obviously DNS failing to resolve the corresponding address. Let's try pinging it first.
Ping could resolve the domain name to an address, and then I suspected the Great Firewall might be doing something again, so I used a tool from ZhanZhangJia to test it. The results were exactly the same as mine.
That was rather strange.
Then, after fiddling with it for a while, I found the problem.
There was a space at the end of the server address I copied.
That was pretty hard to accept. After continuing to tinker for a while and confirming that the problem could be reproduced reliably, I submitted a bug report to the tracker.
And guess what?
My English is completely terrible, so I did not continue talking about it. The issue description was written using a translator.
But honestly, I felt this was kind of absurd.
Since your address is a String, how hard could it be to call trim on it afterwards?
Also, as a player, when you tell me, "This was your own carelessness, so it does not even count as a bug," I cannot accept that.
So, this mod was born.
Configuration file
- If you have version isolation enabled, it should be located at
.minecraft\versions\<version name>\config\ServerAddressSpaceFix.json5 - If you do not have version isolation enabled, it should be located at
.minecraft\config\ServerAddressSpaceFix.json5
This is just a regular JSON text file, except that JSON5 supports additional features such as comments.
All properties include comments, covering things such as functionality, value ranges, types, default values, and more.
You can edit it with a normal text editor.
You can even edit the configuration file while the game is running; it will be applied automatically after saving.
Known issues
All known issues have been fixed. If you find any new ones, please let me know.
If anyone is willing to help fix a bug, PRs are welcome ╰(°▽°)╯
License
I use the even more aggressive WTFPL than MIT.
Project description from Modrinth.
Pick your setup
ServerAddressSpaceFix by Minecraft version and loader
Choose the version and loader you play, then open the matching release.
26.2
1 loader build26.1.2
1 loader build26.1.1
1 loader build26.1
1 loader build1.21.11
1 loader build1.21.10
1 loader build1.21.9
1 loader build1.21.8
1 loader build1.21.7
1 loader build1.21.6
1 loader build1.21.5
1 loader build1.21.4
1 loader buildShowing the newest 12 of 23 game versions. Older files are in the list below.
Check the dependencies, then try the file in a copied instance before changing a world you care about.
Recent files
ServerAddressSpaceFix versions and loaders
0.2.5
ServerAddressSpaceFix-0.2.5 mc26.x.jar
17 Jun 2026
0.2.4
ServerAddressSpaceFix-0.2.4 mc26.x.jar
17 Jun 2026
0.2.3
ServerAddressSpaceFix-0.2.3 mc26.x.jar
4 Jun 2026
0.2.2
ServerAddressSpaceFix-0.2.2 mc26.x.jar
26 Mar 2026
0.2.1
ServerAddressSpaceFix-0.2.1 mc1.21+1.21.x.jar
30 Oct 2024
0.2.0
ServerAddressSpaceFix-0.2.0.jar
14 Jun 2024
0.1.4
ServerAddressSpaceFix-0.1.4.jar
15 Jan 2024
0.1.3
ServerAddressSpaceFix-0.1.3.jar
28 Oct 2023
0.1.2
ServerAddressSpaceFix-0.1.2.jar
28 Oct 2023
0.1.0
twd-sasf-0.1.1.jar
18 Oct 2023
0.1.0
twd-sasf-0.1.0.jar
18 Oct 2023
Looking for an older file? The official Modrinth project page is in Resources.