How to set up ZNC, an advanced IRC Bouncer

Well, an IRC bouncer is similar to a web proxy - all your requests and answers are transmitted via your server in the middle. For IRC, that means that the bouncer is connected to your IRC networks all day instead of you.

It opens a port for your IRC clients to connect (the bouncer just acts like a real IRC server) but it'll replay all the queries and messages from your channels.

I used to have irssi (a popular terminal-based IRC client) running on my server in bouncer mode and another irssi on my computers, but a week ago I couldn't bear with this setup any more. (ok, actually, it broke because of perl updates in Chakra).

All that old perl plugins you had to have to extend irssi in a way to make it usable as a bouncer.. all that old perl plugins you had to have to make irssi usable at _all_.. Well, I liked the full keyboard interface, but you even need a plugin to show named channel windows. Really? Come on!

So I looked through the wikipedia list of IRC bouncers, and the only one that was actually packaged for debian squeeze was ZNC, which turned out to be great. (of course, after all that perl in irssi, python support convinced me ;) ).

Here's my setup:

aptitude install znc
# do this as your personal user
# this will start a configuration wizard
# you'll need to create a separate user for each irc network you're on
# hint for generating random passwords:
# genpw <length>
# activate usefull modules like chansaver, nickserv and simple_away
znc --makeconf
# starts znc as a backgound job of your private user.
# znc doesn't get restarted on boot or after crashes, one way around this is a cronjob trying to start znc every 10 minutes.
# Nothing harmfull will be done if it's already running. If you don't like that, consider running znc as system daemon:
crontab -e
# add the line
# */10 * * * *   /usr/bin/znc >/dev/null 2>&1

Short and sweet, huh?

Then it's time to connect your local IRC client: The server's password is the "username:password" combination you created with the makeconf script.

After that, the only thing left to do is to tell the nickserv plugin about your password for auto-identify with your IRC network's nickserv, and to set your away message. Per default, you'll be away one minute after every client disconnected, as well as you'll be back again if a client is connected for a minute.

/msg *nickserv set <passwort>
/msg *simple_away Reason Hi there, raignarok's server speaking. He's disconnected, but I'm recording for him what you're saying.

As you can see, you're controlling ZNC over special users prefixed with a '*', the general user for ZNC is "*status" and additionally, every module has it's own user. "/msg *<user> help" prints the lists of available options and commands.

That's it for this month, but at least it's something at all after I skipped November. Happy idling, and see you on freenode!

Remarks? Additions? Corrections? For anything you want to tell me about this blog post, feel free to send me an email.
Despite having no comments section (isn't that easy with a static site generator and without relying on a proprietary 3rd party service), I greatly appreciate direct feedback. ;) In case of additions, I'll mention the name from the mail if you don't object.