It's not even that complicated - IRC hostmasks go like this:


you can use * as a wildcard to match any number of characters, or ? to match one character. so

/mode #cowchat +b *!*@

bans any nick/user from the IP,

/mode #cowchat +b *!*@lame*

bans anyone with a host that looks like lame<whatever> - including

but not:

because there's no . before '' as there is in the hostmask.

It's usually a good idea to ban people by host if they're on a dialup - you can usually tell by there being a bunch of numbers in the machine name, e.g. This prevents them from simply disconnecting, changing their username, and returning to the channel.

For more permanent bans, you'll want to use *!username@*.domain.tld. In this case, it's a good idea to use a * or ? at the front of the username if you include the username in the ban - many IRC servers will prepend a ~ to the username if they can't get a proper ident response from the client, so l33tk1d! is probably the same dude as l33tk1d!, but banning *!ejeet@feh* will *not* reliably keep out l33tk1d.