Username:
Password:
  Home About Us Articles Rules Script Library FAQ Help
Not logged in (register
An Introduction to Hostmasks
By Elly

Introduction
Everyone on IRC is identified by a hostmask. A hostmask is really a combination of 3 parts: nickname, username, and hostname. It generally takes this form:
nick!user@host

For example, a hostmask might look like:
test!testserv@my-ip-address.my-isp.net

What are all those parts?
To prevent confusion between users, the IRC server stores 3 pieces of information about each user. The nickname can be changed at any time, with the /nick command. The user (ident) field is determined by the client when it connects - for example, mIRC will use the first part of the e-mail address you enter, the part before the @. The hostname is determined by the IRC server when you connect to it.

How do I find someone's hostname?
To find someone's hostname, you can /whois them. A Whois command takes the form /whois nickname. For example, to find the hostname of JRandomUser, you would type: /whois JRandomUser. mIRC will also automatically store someone's hostmask once it has seen them doing something. It stores the hostmasks in the IAL, the Internal Address List. To see someone's stored address in mIRC, you type: //echo -a $ial(nickname). For example, if JRandomUser had joined your channel, and you wanted to see his hostmask, you would type: //echo -a $ial(JRandomUser). Remember, this will only work in mIRC.

Why is all this important?
The hostmask is used for many things in IRC. The most important of these is, of course, for the server, so it knows which client is which. Also, mIRC's access lists use it, and it is commonly used in bans and exceptions. In order to properly ban someone, you must understand how a hostmask works. If you intend to ban someone just for a moment - say, for example, their script is autorejoining and you want to remove it - you can ban them by nickname, but these bans are easy to evade. A ban by hostname is difficult to evade, however, the user may be able to change their hostname by signing off and back on to the internet again - this applies particularly to AOL users, who are given a random hostname whenever they reconnect to the internet. Bans can use "wildcards", in particular "*" and "?". "*" can replace any number of characters (including zero), and "?" can replace exactly one character. For example, to ban someone by their hostname (no matter what nickname or username they use), you would put a ban with the format *!*@hostname. For example, to ban "test" from #mychannel by hostname (if he/she was using the above hostmask), you would type: /mode #mychannel +b *!*@my-ip-address.my-isp.net. Now, let's look at the parts of that ban.

*!*@my-ip-address.my-isp.net

You may notice that the "nickname" field has been replaced with a "*". This means that no matter what nick is used, the ban will still match. Next is a "!". The "!" separates the "nickname" field from the rest of the hostmask. After the "!" is another "*", this time replacing the "username" field. That means, again, that any username will match this ban. Then comes the "@" symbol. The "@" symbol separates the hostname from the rest of the hostmask. The hostname afterwards indicates that anyone with that hostname is not allowed to join the channel. Bans can also take other forms:

test!*@* - With this ban, anyone with the nick "test" - regardless of username or hostname - cannot join the channel.
*!testserv@* - With this ban, anyone with the username "testserv" cannot join the channel, regardless of nickname or hostname.
test!*@my-ip-address.my-isp.net - With this ban, anyone with the nickname "test" whose hostname is "my-ip-address.my-isp.net" cannot join the channel.
*!*@* - With this ban, no one at all can join the channel!
*!*@*my-isp* - With this ban, anyone with "my-isp" anywhere in their hostname cannot join the channel.
*test*!*@* - With this ban, anyone with "test" anywhere in their nickname cannot join the channel.
test??!*@* - With this ban, anyone with "test" followed by two characters as their nickname cannot join the channel.
*test*!*@my-ip-addr???.my-i?p.ne* - This complicated ban will prevent anyone with "test" in their nickname from joining the channel, provided that their hostname takes the form "my-ip-addr3 characters.my-i1 characterp.neanything

 
All content Copyright © 2004 - 2008 UtoNet IRC Network
UtoNet is sponsored and hosted by Datinix Systems