Centralized banning is a (new!) feature within the Rust dedicated server which allows server owners to build a synchronized, external ban list that can be shared across multiple servers.
You will need a web server (HTTP or HTTPS) which hosts the centralized banning API. We do not provide an implementation of this API but it is relatively simple to implement. Some third-party implementations are listed in the FAQ below.
To enable it on your server, simply set the
server.bansServerEndpoint convar to your web server API endpoint. For example:
Once set, the Rust dedicated server will query that API endpoint to check if players are banned at the time they join the server.
server.bansServerEndpoint is set to something like "https://domain.tld/api/rustBans/", your web server will receive requests like these from the Rust dedicated server.
Returns the ban status for a 64-bit SteamID in JSON format.
Note: The URI for this request is generated by appending the 64-bit SteamID to the value of
server.bansServerEndpoint, with a forward slash if required.
|steamId||The 64-bit SteamID the ban is for. This is used to sanity check that the API implementation is returning the correct bans.|
|reason||The reason for the ban. This will be displayed to the player when they connect to the server.|
|expiryDate||Unix timestamp that sets when the ban expires. This will be used to show the time remaining on the ban to the player when they connect to the server. Values less than or equal to zero indicate that the ban is permanent.|
The Rust dedicated server will also check the web server's response code:
|2xx||Success codes (2xx) require the JSON format above to be returned in the response body.|
|404||Not found indicates that the requested 64-bit SteamID is not banned.|
|Other||Redirects should be handled by Unity, but error codes will result in a failure (see
No, centralized banning will only prevent players from entering the server. If you want them kicked from the server immediately then you will need to use the
kick command on whichever server they are on.
A message will be logged to the Rust dedicated server console whenever the centralized banning system encounters an error. A separate convar (
server.bansServerFailureMode) controls what happens to players who failed to be checked:
|0||Players are allowed into the server when an error occurs (message logged in server console)|
|1||Players are rejected from joining the server when an error occurs (message logged in server console, also visible to player )|
The default timeout for all centralized banning requests is set to five seconds. This should be more than enough but if it is causing issues then you can adjust it using the
server.bansServerTimeout convar (the value is in seconds). Keep in mind that the longer the requests take the longer players will need to wait to join your server - try to make your API faster instead of increasing the timeout.
You do not need to restart your server after changing
bansServerTimeout. However, players already on the server will not be kicked when enabling or changing
I run Rust servers and want to use centralized banning, but I don't know any programmers. Are there any public implementations available?
The API is designed in a way where it is possible to use with as little as an HTTP server available. You can upload JSON files to a folder and have the Rust server read them - this is less convenient because it will get hard to manage all the files but it will still work.
Below is a list of known implementations that you may be able to use:
- https://github.com/AdriaanBoshoff/RustCentralBanServer (Free - GPL)
- https://codefling.com/tools/centralized-banning (Free - MIT)