hostfile Command

Explore usage, syntax, and examples for the hostfile CS2 developer console command.

hostfile

CS2 and CSGO

Command

hostfile

<File Name>

Sets the server's hosts file (default is hosts.txt). If no file name is given, it displays the current hosts file in use.

<File Name> (Optional)

Optional. Specify the name of the hosts file to set for the server. If omitted, the command shows the current hosts file name.

sv_cheats Required

No

Client or Server Command

Server

Default Value

host.txt

hostfile Generator

Command

hostfile

Ready to Copy

Set the options below to auto-generate your command. When everything looks good, click the Copy button and paste it into your in-game console.

hostfile Examples

Command

hostfile

hosts.txt

Sets the hosts file to the default hosts.txt.

Command

hostfile

examplehosts.txt

Changes the server's hosts file to examplehosts.txt.