How to Use the Ban-IP Command in Minecraft

This Minecraft tutorial explains how to use the /ban-ip command with screenshots and step-by-step instructions.

Let's explore how to use this game command.

Supported Platforms

The /ban-ip command is available in the following versions of Minecraft:

PlatformSupported (Version*)
Java Edition (PC/Mac) Java Edition (PC/Mac)Yes
Pocket Edition (PE) Pocket Edition (PE)No
Xbox 360 Xbox 360No
Xbox One Xbox OneNo
PS3 PS3No
PS4 PS4No
Wii U Wii UNo
Nintendo Switch Nintendo SwitchNo
Windows 10 Edition Windows 10 EditionNo
Education Edition Education EditionNo

* The version that it was added or removed, if applicable.
NOTE: Pocket Edition (PE), Xbox One, PS4, Nintendo Switch, and Windows 10 Edition are now called Bedrock Edition. We will continue to show them individually for version history.

Background

The /ban-ip command is an advanced server command that is only used if you are running a Minecraft server. If you are operating a Minecraft server that other players connect to, the /ban-ip command can help manage which players are not allowed to connect the server.

To use the /ban-ip command, you must be an operator of the Minecraft server. The /ban-ip command is used to add an IP address to the server's blacklist (or ban list). This will ban all players from that IP address from connecting to the Minecraft server. Use the /pardon-ip command to allow the players to connect to the server again.

TIP: To ban an IP address on a Minecraft server, you can either provide a valid IP address or the name of a player that is currently online whose IP you wish to ban.

When the /ban-ip command is issued, any player from that IP address will immediately be disconnected from the server. If a player from that IP address tries to reconnect to the server after the IP address is banned, the player will not be allowed to connect to the Minecraft server.

Requirements

To run server commands such as the /ban-ip command, you have to first create a multiplayer server in Minecraft and be the operator of that server.

Ban-IP Command

Examples

How to Enter the Command

1. Open Server Console

To run a server command, the instructions vary depending on your version of Minecraft:

  • For Java Edition (PC/Mac), open a server console. Use Command Prompt in Windows or Terminal on a Mac.

2. Type the Command

We will cover examples of how to use the /ban-ip command to add an IP address to the server's blacklist using an IP address as well as the name of a player that is online.

Ban an IP using the IP Address

The easiest way to ban an IP address is by specifying the IP address in the /ban-ip command.

For example, you could ban an IP address with the following command:

/ban-ip 172.16.5.128

To enter the /ban-ip command in Minecraft, you must enter it as a server command (see below):

ban-ip command

You should see the message "Banned IP address 172.16.5.128 belonging to TheNotWanted" appear in the server console.

Once the command has been entered, the IP address 172.16.5.128 will be added to the server's blacklist and banned from the server. Any players (ie: TheNotWanted) that are connected to the server with that IP address will be immediately disconnected from the server with the following message:

completed ban-ip command

In this example, the player named TheNotWanted will see the message "Connection Lost. You have been IP banned." in the game window.

Ban an IP Address using an Online Player

If you know the name of the player that is currently online whose IP address you wish to ban, you can enter the player name in the command instead.

For example, you could ban an IP address using the player name with the following command:

/ban-ip TheNotWanted

In this example, we have entered the player name TheNotWanted. Since the IP address for TheNotWanted is 172.16.5.128, this IP address will be banned and added to the blacklist (or ban list). For this command to work, the player MUST be online when you issue the /ban-ip command using a player name.

To enter the /ban-ip command in Minecraft, you must enter it as a server command (see below):

ban-ip command

You should see the message "Banned IP address 172.16.5.128 belonging to TheNotWanted" appear in the server console.

Now any players that are connected to the server with that IP address of 172.16.5.128 will be immediately disconnected from the server with the following message:

completed ban-ip command

In this example, the player named TheNotWanted will see the message "Connection Lost. You have been IP banned." in the game window.

To remove the IP address from the blacklist (or ban list), the server operator must use the /pardon-ip command.

Congratulations, you just learned how to use the /ban-ip command in Minecraft!

Other Server Commands

Here are some other server commands you can use in Minecraft: