I just figured this out today. If I'm all wrong, please please let me know.

/mode #channel +b *nick*!*ident*@*.host.domain

/mode invokes the channel mode command. Used for so much more than banning.

#channel, is, of course, your current channel.

+b means add a ban directive.

* are wildcards. Also ? can be used as single character wildcards.

nick is the nick or part thereof of the person/bot/alien you are trying to ban.

! is the divider between nick and ident.

ident is the name they have set for themselves in their ident reply to the irc server. This is often your username, but not always. Many IRC clients let you set this.

If they are on a dialup account, generally the first part of their host string is going to be changeable, so you want to account for that by putting a * (wildcard) in there.

hostname, well, the base host name

and domain, the domain.

To unban, put in the exact same banned string but with a -b instead of a +b.

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

nick!username@machine.domain.tld

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

/mode #cowchat +b *!*@3.1.33.7

bans any nick/user from the IP 3.1.33.7,

/mode #cowchat +b *!*@lame*.isp.com

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

lame-1-2.isp.com
lame.1.north.isp.com
lamewoohoo.isp.com

but not:

lameisp.com

because there's no . before 'isp.com' 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. lame-3-1-33-7.dialup.isp.com. 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!~ejeet@feh-15-2.dialup.isp.com is probably the same dude as l33tk1d!ejeet@feh-15-2.dialup.isp.com, but banning *!ejeet@feh*.dialup.isp.com will *not* reliably keep out l33tk1d.

dig?

Log in or registerto write something here or to contact authors.