it is useful sometimes to be able to ban certain troublemakers
you are on. To do this you need to have ops
on the channel you want to ban them from.
Banning is done with the +b channel mode. You use this typically to ban wildcards of hostmasks. Everyone on IRC has a hostmask: it looks like this:
The first part is their IRC nick.
The second is their username. This part is not very important nowadays as it is much rarer now for people to be IRCing from multi user systems. It is common for the IRC server to query the ident server on your computer when you connect to verify the username. On some IRC networks servers will let you in if they cannot verify your username, but you have a '~' prepended to the front.
The third part is their host name. If no reverse DNS is set up properly this will be an IP.
An example of a naive banmask is something like this:
What this does is to ban by their nickname only. Clearly this is not a very effective banmask; all they need to do is change their nick and rejoin the channel. Something better would be:
This bans a particular user from a particular host, which is generally better. Note the '*' at the start, this is to catch possible ~'s if they are verified or not. It is common for inexperienced people to do something like:
-:- mode/#everything (+b *!fraggle@*.plus.com) by jethro_bodine
Now all they need to do is change their username. If this happens (or is likely to happen) you can do:
Which bans all users from that particular host. Of course, many ISPs use dynamic DNS, so if this person is incredibly determined to get into your shonky little IRC channel, they can hang up their modem, reconnect and get a different host. If this is the case, do something like:
This bans all hosts in the 'plus.com' domain. Typically this is rather overkill though, as you could be banning other legitimate users who may be using the same ISP.
Note that for IP'd hosts this is the other way round: networks go from the left side rather than the right, so for example: