# Wesnoth Server Admin Commands (/query admin, kick, ban, motd)

Moderate your own Wesnoth lobby: log in with /query admin, then kick, kban, ban, unban, set the motd, broadcast and stop games. Syntax and ban times explained.

Updated 2026-10-07. https://gamezservers.com/guides/wesnoth-server-admin-commands

To use admin commands on your own Wesnoth server, type `/query admin yourpassword` in the lobby chat, using the `passwd` value from `wesnothd.cfg`. After that, commands go through `/query`: `/query kick <nick> [reason]`, `/query kban <nick> <time> <reason>`, `/query ban <nick or ip> <time> <reason>`, `/query unban <ip>`, `/query motd <text>`, `/query lobbymsg <text>` and `/query stopgame <nick> [reason]`. `/query help` lists everything your server version supports.

These are the commands of `wesnothd`, the server program. They work on any server you run, and they are the same ones the official server's moderators use.

![A Battle for Wesnoth multiplayer game in progress](https://gamezservers.com/games/the-battle-for-wesnoth/shot-5.webp)

## Logging in as admin

The admin password is the `passwd` key in `wesnothd.cfg`:

```
passwd="a-long-admin-password"
```

In the lobby, type:

```
/query admin a-long-admin-password
```

The server confirms you are an admin. Type it in the lobby chat, not in a private message window or a game's chat, and check for typos before you hit Enter so the password does not end up in public chat. `/query signout` drops your admin rights again.

If nobody sets a `passwd`, there is no admin login on that server at all.

## Commands anyone can use

Some queries are open to every player:

| Command | Shows |
|---|---|
| `/query help` | Available commands |
| `/query stats` | Current number of users and games |
| `/query status` | Your own connection info |
| `/query motd` | The message of the day |
| `/query version` | The server version |
| `/query metrics` | Server performance figures |
| `/query report <message>` | Sends a message to the admins, for reporting abuse |

## Finding the right person

| Command | What it does |
|---|---|
| `/query status` | As admin: all users with their IP addresses |
| `/query status <mask>` | Users matching a nickname or IP mask |
| `/query clones` | Users sharing the same IP |
| `/query searchlog <mask>` | Searches the connection log for nicknames and IPs |

Masks accept `*` and `?` wildcards, so `/query status Troll*` finds every nickname starting with Troll. Wesnoth lobbies without a registration database let anyone pick any free name, so `searchlog` and `clones` are how you connect a returning troublemaker to their old names.

## Kicking and banning

```
/query kick Troll42 Spamming the lobby
/query kban Troll42 1D Repeated spam after warning
/query ban 203.0.113.* 7D Ban evasion
/query bans
/query unban 203.0.113.*
```

- **kick** disconnects the user. They can come straight back. A reason is optional.
- **kban** kicks and bans in one step. A time and a reason are required.
- **ban** bans by nickname mask or IP mask. With a nickname, the server bans the IP that user is connected from. Anything with a dot is treated as an IP mask. A reason is required, the command refuses without one.
- **bans** lists current bans. **unban** removes a ban by IP mask.

Bans are IP based, which means two things: shared networks (a school, a dorm) get banned together, and anyone with a new IP is back. Use short bans first.

## Ban time format

Times are numbers with units, combined freely:

| Unit | Meaning |
|---|---|
| `s` | seconds |
| `m` | minutes (the default if you write no unit) |
| `h` | hours |
| `D` | days |
| `M` | months |
| `Y` | years |

`1D12h` is a day and a half, `30m` is half an hour. `permanent` or `0` makes a ban permanent. You can also define your own shortcuts in `wesnothd.cfg`:

```
[ban_time]
    name="week"
    time="7D"
[/ban_time]
```

Then `/query kban Troll42 week Repeated harassment` works. Keep `ban_save_file` set in the config so bans survive a restart.

## Talking to the lobby

```
/query motd League round 3 starts Friday 20:00 UTC. Check the forum for pairings.
/query lobbymsg Server restart in 10 minutes, please finish your turns.
/query msg Server restart in 10 minutes.
/query pm Alice Your match is reported, thanks.
```

`motd` changes the message of the day until the server restarts. To make it permanent, put it in `wesnothd.cfg` as `motd="..."`. `lobbymsg` reaches players in the lobby, `msg` reaches everyone including players in games, and `pm` sends a private message as the server.

## Ending a game

```
/query stopgame Hostname Abandoned game holding a slot
```

`stopgame` ends the game hosted by that nickname. Use it for games left open by someone who walked away, or for a game being used to harass people.

Game hosts have their own tools inside their game: the host can remove a player from that game without any admin rights. Server admin commands are for the lobby as a whole.

## Restricting who can log in

```
/query dul yes
```

`dul` is short for `deny_unregistered_login`. It only does anything on servers with a user database (the `[user_handler]` section, which the official server uses with its forum accounts). On a simple private lobby without registration, keep your lobby private with a firewall rule or an unlisted address instead.

## Reloading and stopping the server

On Linux you can reload `wesnothd.cfg` without dropping anyone by sending the process `SIGHUP`. Remote shutdown and restart through `/query` are off unless `allow_remote_shutdown=yes` is in the config; by default they only work through the server's command fifo.

![Wesnoth units across a river map](https://gamezservers.com/games/the-battle-for-wesnoth/shot-1.webp)

## Moderating a lobby with GamezServers

On a [Wesnoth server with us](https://gamezservers.com/games/the-battle-for-wesnoth), the **Admin Password** and **Message of the Day** are fields in the [control panel](https://gamezservers.com/docs/control-panel) and are written into `wesnothd.cfg` each time the server starts, so the `/query admin` password is always the one you set there. Everything else, from `ban_save_file` to `[ban_time]` shortcuts, is in the file manager. A restart button applies changes, and the live console shows joins, kicks and bans. For setup see [how to host a Battle for Wesnoth server](https://gamezservers.com/guides/how-to-host-a-battle-for-wesnoth-server), and if players cannot get in at all, check the [version mismatch fix](https://gamezservers.com/guides/wesnoth-server-version-mismatch-fix).

## FAQ

### How do I become admin on my Wesnoth server?

Set `passwd` in wesnothd.cfg, then type `/query admin` followed by that password in the lobby chat.

### What is the difference between kick, kban and ban in Wesnoth?

kick disconnects without a ban, kban kicks and bans in one step, and ban adds a ban by nickname or IP mask without needing the user to be online if you use an IP.

### Why does my Wesnoth ban command fail?

Usually a missing reason or an unreadable time. ban and kban need a time like `1D` and a reason after it.

### Does /query motd change the message permanently?

No. It lasts until the server restarts. Put the message in wesnothd.cfg, or the panel's Message of the Day field, to keep it.
