That is called a vhost, and can be given out on most IRCds by IRC Ops. Some IRCds also hide your real IP if you use usermode +x. Another way to hide your IP is to connect through proxies, etc.