CS2 Server Name Change: Step-by-Step Guide
In this article
This guide shows you how to change the name of your Counter-Strike 2 dedicated server, whether it's a public community server or a private one. You'll learn the exact commands and configuration file edits needed, plus how to fix common issues like the name not appearing in the server browser.
What You'll Need
- Access to the server's command line or console (for a dedicated server)
- Access to the server's configuration files (usually
server.cfgorautoexec.cfg) - For a hosted server: the hosting provider's control panel or file manager
- For a local server: the ability to edit text files on the machine running the server
Step-by-Step
- Locate your server's configuration file. The most common file is
server.cfg, located in thecsgo/cfgfolder of your server directory. If you don't have one, create it with a text editor. - Open the configuration file with a plain text editor (Notepad, VS Code, etc.). Do not use a word processor like Word, as it may add formatting.
- Find the line that sets the hostname. It typically looks like
hostname "My Server". If it doesn't exist, add it at the top of the file. If it exists, edit the text between the quotes to your desired server name. For example:hostname "My Awesome CS2 Server". - Save the file and close the editor.
- Restart the server to apply the change. If you're using a control panel, use the restart button. If you're on a command line, stop the server process and start it again.
- Verify the change by connecting to your server and checking the name in the server browser or the scoreboard. You can also type
hostnamein the server console to see the current name.
Alternative method (command line): If you start the server from a command line or batch file, you can pass the hostname directly as a launch parameter. Add +hostname "Your Server Name" to your startup command. This overrides the config file value.
For hosted servers: Many hosting providers have a "Server Name" field in their control panel. If so, just change it there and restart the server. If not, use the file method above.
Common Mistakes
- Editing the wrong file: Make sure you're editing
server.cfg(or the file your server actually reads). Some servers useautoexec.cfgor a custom config file specified in the launch options. - Using a word processor: Saving a .cfg file from Word can add invisible characters that break the command. Always use a plain text editor.
- Not restarting the server: Changes to the config file are only read when the server starts. If you don't restart, the old name stays.
- Quotes missing: The hostname command requires quotes around the name if it contains spaces. Forgetting them can cause the server to fail to start or use only the first word.
- Using a name that's too long: CS2 has a limit on server name length (usually around 63 characters). Longer names get truncated.
Tips
- Make your server name descriptive but not too long. Players see it in the browser, so include keywords like "24/7 Dust2" or "Retake" if relevant.
- If you run multiple servers, use a separate config file for each to avoid confusion.
- Test the name change on a local server first if you're unsure about the process.
- Keep a backup of your server.cfg before making changes, just in case.
- If you use a custom config file, make sure it's executed at startup. You can check by typing
exec server.cfgin the server console.
Troubleshooting
Server name didn't change after restart:
- Check that you saved the file correctly and that the line is not commented out (lines starting with
//are ignored). - Make sure the server is actually reading that config file. Try adding a test command like
say "Test"to the file and see if it appears on the server after restart. - If you're using launch parameters, they override the config. Remove the
+hostnameparameter if you want the config to take effect. - For hosted servers, some panels cache the config. Try a full stop and start instead of a restart.
Server name shows as "Counter-Strike: Global Offensive" or the IP:
- This usually means the hostname command isn't being executed. Check the config file path and that the file is named correctly.
- Ensure the server has write permissions to the config file if you're editing it in place.
Server fails to start after editing:
- Remove any special characters (like emojis or non-ASCII characters) from the name. Stick to letters, numbers, spaces, and basic punctuation.
- Check for missing quotes or extra spaces in the command.
- If you added the command to a config that wasn't there before, make sure the file is saved in UTF-8 without BOM encoding.
Frequently Asked Questions
Q: Can I change the server name without restarting?
A: No, the hostname is set at startup. You can change it in the console with hostname "New Name" but it will revert on the next restart unless you also edit the config file.
Q: Where is the server.cfg file located?
A: It's in the csgo/cfg folder of your server installation. For example, C:\steamcmd\cs2\game\csgo\cfg\server.cfg.
Q: What's the maximum length for a server name?
A: The limit is 63 characters. Anything longer will be cut off in the server browser.
Q: Can I use spaces and special characters in the name?
A: Spaces are fine, but avoid special characters like quotes, backslashes, or non-ASCII symbols. They can cause issues.
Q: My hosting provider has a "Server Name" field, but it doesn't work.
A: Some panels override the config file. Try setting the name in the panel, and if it still doesn't work, contact support. Alternatively, you may need to edit the config file directly via FTP.
Q: Will changing the server name affect my server's IP or port?
A: No, the name is purely cosmetic and doesn't affect networking.