IRC in the modern age

Dan Eveland's picture
PrintEmailPDF

This article is for people somewhat experienced with Linux to give them an overview of how to get IRC running in a practical fashion. Let me say I am not an old hand or expert at this, but I've been doing it long and well enough that I thought someone starting out might appreciate the guidance. This is how I do it, and you may have, or find, better ways. Good for you.

What is IRC? Internet Relay Chat. Old school communications protocol. In Internet terms, very old. Like Newsgroups old. However, for some reason, the open source community has embraced it. Most of the technologies I use on a daily basis, from Linode to Drupal to Apache, MySQL and Ubuntu.... all are well-represented and supported by the community there. It's simply the best place to connect with people that write Open Source code, or work with Open Source technologies in a deep way. Most of these people are on Linux boxes or Macs and keep an IRC window open all the time. A lot even run it in a terminal. Gross.

Oh yeah, furries and other deviants that use mIRC in Windows or JavaScript browser-based clients also utilize IRC a lot. This article is not intended for that kind of user. Also... gross. My appearance in any of those channels is strictly for testing purposes, or my account has been hijacked. Really.

Why do people use this?

Why is this popular? Well... I have my theories. The main one is that IRC sucks ass. What? I just said it sucks, and that is supposed to be a reason to use it? Well... yes. It sucks to set up and it sucks to keep it running all the time. Those who are not technical and dedicated enough won't bother to learn it. Most (99% maybe?) will fall back onto good old email (or worse... a forum) as soon as they see the configuration screen for an IRC client. The fact is you need to have a certain level of technical skill, and be focused enough, to figure out all the various settings and options. In some ways, it's like a weird vetting process. If you can get onto IRC and can get nickserv to work, you have passed a kind of test.

I am sure there are many more legitimate reasons about Internet freedom, about a network of servers run by mostly volunteers and Open Source software, blah blah blah. Probably.

Stick with it

To get much out of it, you have to do it over long periods of time. You have to give back, too. You will be taken much more seriously if you are hanging out in the channel all day, answering the occasional question. Then, when you do have a question, you'll be more likely to get an in-depth answer. Anyway, that's the way I think it happens. This is the reason why I sit in channel all day and try and help, because I get answers many times there that would take hours or days on a conventional forum. 

Lots of people, in a desperate attempt to solve a particular technical issue, figure out how to get into IRC. They struggle and find the right channel, post a question, then get all pissy or impatient when no one jumps up and answers the question. Or, worse yet, they repeat the question. Bad move. Never do that unless at least 12 hours have passed. Then those people generally leave, never to return. What a waste of time for everyone. Let me make this clear, set your expectation pretty damn low for free support for free software. If you do that, then you will be occasionally surprised (in a good way) by the support you receive.

And for goodness sake, put your question into Google before you do the chat window. You are far more likely to find the resolution yourself with a good Google search. IRC is when you get into the really deep and arcane stuff (for your skill level), or have such a specific question, that generic stuff on Google won't help.

At the bottom of this article is a link on IRC etiquette. Read it. Learn it. Live it. People take it very seriously in an IRC channel. Oh, don't say "chat room"! It's a "channel"...like on TV, but completely different.

What about when I'm not staring at my screen?

OK, so this is where things get interesting. Nowadays, most people simply can't sit at a desk all day. They go about doing business, then come back. If your computer went to sleep, or you actually turned it off (do computers still do that?), then you will miss everything that happened in IRC. And if you are waiting for your latte elsewhere, you won't be able to chime in on your favorite subject you have all the answers for when the perfect question arises back at your desk. This, my loyal readers, is was a bouncer is for.

A bouncer is a program that runs on a system that is usually a server which is always on and always connected to the Internet. It is what connects to IRC and logs all the activity taking place for you. You then point your IRC client at that system instead of the IRC servers directly. That way, your bouncer always stays connected, and it records events in each channel. When you connect to the bouncer, it "replays" back the conversation it has logged. At that point you can do anything you would normally be able to do if you were directly connected to the chat server. Everything you do is relayed through the bouncer.

The ZNC bouncer

The most popular, and best-functioning, bouncer out there is ZNC. It runs on a variety of platforms and seems super-stable to me. As previously mentioned, it should be run on a system that is always on and always connected to the Internet. I use a virtual Ubuntu server running under VirtualBox on my development box. I decided to use a VM for security. That way, if anyone somehow used my running ZNC or the znc user to break into that server, all they would get is a VM. A VM that I have a clean clone of elsewhere, by the way. In the links below, you will see documentation on installing it in Ubuntu. I went the repository path and am running ZNC 1.0. As of the writing of this article, 1.2 is out if you want to compile it yourself. I don't, so I went with a pre-made binary via adding a repository and using apt-get install. A link at the bottom of this page will show you how.

Once you install it, you should make a user for it. A standard Ubuntu Linux user is fine. I made a user called "znc". Imaginative, I know.

Once you have a user, then you can log in as that user, and do:

znc --makeconf.

This will create a configuration file for you based on your inputs in ~/.znc. Then you can edit that to taste. It says not to edit it directly. I chose not to take that advice. I'm a rebel.

Now, I wanted to make znc startup automatically in case the server was rebooted or lost power and came back on. I could not find any good documentation on this, so I logged in as znc, did a

crontab -e

and added this line:

*/10 * * * * /usr/bin/znc

After all that, ZNC will open within 10 minutes of a reboot. It's OK to try and run ZNC once it's already running. It just displays an error message and fails. No problem.

Once this is running, you should be able to hit ZNC by using a web browser. Just type in the server's address and follow it with the specific port you picked when you made your configuration in ZNC. So, if you use 88, then it would be:

http://yourservername.com:88

Now, the next step is to configure your various connections. You can do all this in this web GUI. It's fairly strait-forward if you already know about IRC. If not, start Goggling.

One very important area is the top of the "Edit Network" page. For example, my freenode connection for my main user is here (I have turned anything specific into "xxx" because of assholes on the web and maybe people will search for xxx):

http://xxx.dyndns-home.com:xxx/mods/global/webadmin/editnetwork?user=duckydan&network=freenode

​It shows what should be entered in as the IRC server username. This is important, and may take you a few tries, as it looks slightly different in each IRC client.

But my server changes address changes and I can't hit it directly from the Internet!

Here are some recommendations you need to consider if you are running this in a typical small network environment.

  1. Keep in mind you may have to use port forwarding on your server. I forward my ZNC port to my Ubuntu VM. If you use virtual systems for this, make sure to set them for "bridged" networking. That will give the VM a real IP address on your local network. That's needed for port-forwarding.
  2. Another hint is to reserve the MAC for your virtual machine with your local network DHCP services, so that you don't have to change the port-forwarding in the case your ZNC server changes local IP. If you use a virtual machine, it will have a MAC set in the configuration GUI for the VM.
  3. To have your various IRC clients be able to reliably get to your ZNC server, it really needs to be at either a static IP, or have some kind of dynamic DNS service. I use Dynamic DNS. For a small fee per year you can have a URL that can be updated with your home or office IP address. A link to Dynamic DNS is in the links section at the end of this article.
  4. You can also use a utility to automatically change the dynamic DNS setting in case your ISP changes your IP. In my case, I use ddclient. A link to this is at the end of the article.

Wasn't this great?

I hope you found the information here helpful. I know I have spent many late nights, desperately Goggling, trying to make all this work. But now, I have LimeChat running on a MacBook Pro Retina, 27" iMac, iPhone 4S and a 3rd Generation iPad. All of my devices now can access my ZNC bouncer simultaneously and I can chat and keep up with what's going on wherever I am and whenever I want.