Skip navigation

ZNC is an IRC bouncer with some pretty nice features. For a number of reasons I wanted to move my ircing from home to a shell, so I decided to give ZNC a try. ZNC isn’t in ports, but compiles fine using gmake.

The only problem I encountered was getting it set up to work with multiple networks in irssi. Configuring ZNC itself to put me on many networks was easy enough, and when I connected irssi to it for each network using /connect it worked fine. Using /server add to set up irssi’s server list didn’t work out so well.

Every time I tried to add another server (for connecting to another network), irssi would remove the first one. This is because irssi only considers a server’s hostname and port when trying to work out if it’s unique. When I added another server which differed from the first only by password and associated network, irssi assumed I was updating the existing one and changed it. Putting the required entries in irssi’s config by hand also didn’t work.

The solution was easy enough; one ZNC instance can listen on multiple ports, so I got it to listen on a selection of ports using multiple Listen directives in its config file, and then added each network’s server to irssi using a different port number.

Now I can take advantage of cool things like buffer replay and detaching from channels. Sorry, irssi-proxy – you don’t quite cut it now :)


    • AndreaStella
    • Posted May 6, 2011 at 04:42
    • Permalink

    irssi considers address/port pairs for servers unique.

    To get around that limitation, you can either set up your bnc to listen on different ports for each user/chatnet, or you can use a different (fake) name for each server address.

    I think the latter is more elegant and resource efficient.

    In ~/.irssi/config:

    servers = ( { address = “fake.efnet.kk”; chatnet = “EFNET”; port = “55555”; password = “bncpassEFNET”; }, { address = “fake.freenode.kk”; chatnet = “FNODE”; port = “55555”; password = “bncpassFNODE”; } )

    chatnets = { EFNET = { type = “IRC”; username = “bncuserEFNET”; }; FNODE = { type = “IRC”; username = “bncuserFNODE”; }; };

    In /etc/hosts: fake.efnet.kk fake.freenode.kk

    Thus, the fake addresses all resolve to your bnc address and all is fine.

    • lukano
    • Posted May 11, 2010 at 17:15
    • Permalink

    Do you have an example of how you defined different ports to each network?

    Hoping for a response as the topic’s so old, but I’ve run in to the same issue and it’s the only thing holding me back from loving znc.

    • golden
    • Posted May 3, 2010 at 14:23
    • Permalink

    Patch is here:

    and it was applied in trunk on 20100321, so only the latest stable would contain this work around

    • chicken
    • Posted April 20, 2009 at 10:36
    • Permalink

    llutz: I had the same issue. For me these entries in irssi config file in the chatnets section did the trick: znc1 = { type = “IRC”; username = “username1”; }; znc2 = { type = “IRC”; username = “username2”; };

    • llutz
    • Posted January 17, 2009 at 22:44
    • Permalink

    even with 2 “Listen” statements and 2 configured users, i’m always connected to the same “user1”-account. can you plz show your anonymized znc.conf / irssi.conf? tia, llutz

    • phisher1
    • Posted December 5, 2008 at 18:03
    • Permalink

    duck said I should comment.. znc is in ports now =)


  1. I did yes, and it didn’t seem to help. Are you using -ircnet instead of -network because you’re using an old irssi or because you’re used to old irssi? :) Maybe older irssis don’t try to be so clever with the server list…

    • d0h
    • Posted April 24, 2008 at 09:16
    • Permalink

    Have you tried to add the -ircnet switch to your connect statement ? I’m running two connects to the same znc without any problems.

  2. I am only running one ZNC, but I need it to listen on multiple ports else irssi can’t tell the difference between my networks. So I just have one ZNC listening on a couple of ports, and each network in irssi is configured with a different port number.

    • someone
    • Posted March 8, 2008 at 10:48
    • Permalink

    hey, why do u start multiple instances of znc? you can create more than one user on one znc… just try it. enabling the webinterface makes things so much easier. :)

One Trackback/Pingback

  1. […] About 6 hours in, and I’m loving it.  IRC session ubiquity and I’m happy.  I can pop it up on my phone and IRC on the go, or just use a local client on my mac instead of sshing back home and using irssi.  I’ll probably still use irssi 99% of the time, but having options and being able to jump on from my phone will help.  IRC, how like crack you are and how I can’t quit you.  I did run into one problem with irssi and it not being able to do multiple connections to what it thinks is the same host, but I found a way around it after reading this. […]

Leave a Reply

Your email address will not be published. Required fields are marked *