Introduction
ZNC is a powerful IRC (Internet Relay Chat) bouncer (commonly called a "BNC") that keeps you connected to IRC servers even when your IRC client is offline. Instead of connecting directly to an IRC network, your IRC client connects to ZNC, and ZNC maintains the connection to the IRC server on your behalf.
This allows you to reconnect at any time without losing messages or your nickname, making ZNC an essential tool for users who spend a lot of time on IRC.
What Is ZNC?
ZNC is an open-source IRC bouncer that acts as an intermediary between your IRC client and an IRC server.
The connection works like this:
IRC Client
│
▼
ZNC Server
│
▼
IRC Network
Instead of disconnecting from IRC when you close your client or lose your internet connection, ZNC remains online 24/7 and continues to receive messages, maintain your nickname, and stay connected to channels.
When you reconnect, ZNC can play back messages you missed while you were away.
Why Use ZNC?
ZNC offers several advantages over connecting directly to IRC.
Stay Connected
Your IRC nickname remains online even if:
- You close your IRC client
- Your computer shuts down
- Your internet connection drops
- You switch devices
Playback Missed Messages
One of ZNC's most useful features is its playback capability.
If someone sends messages while you're offline, ZNC stores them so you can read them after reconnecting.
Connect from Multiple Devices
You can use multiple IRC clients simultaneously.
For example:
- Desktop computer
- Laptop
- Mobile phone
- Tablet
All devices stay synchronized through the same ZNC instance.
Secure Connections
ZNC supports:
- SSL/TLS encryption
- Client certificates
- Password authentication
- IPv4 and IPv6
Modular Design
ZNC supports modules that add functionality such as:
- Message playback
- Push notifications
- Logging
- Auto replies
- Web administration
- Buffer management
Common Use Cases
People use ZNC to:
- Stay online 24/7
- Never miss IRC conversations
- Connect from multiple devices
- Maintain a persistent nickname
- Log IRC activity
- Manage multiple IRC networks
System Requirements
ZNC runs on:
- Linux
- FreeBSD
- OpenBSD
- NetBSD
- macOS
It can also be compiled on Windows, although Linux is the most common deployment platform.
Installing ZNC
Ubuntu/Debian
sudo apt update
sudo apt install znc
CentOS/Rocky Linux
sudo dnf install znc
Build from Source
Download the latest source code.
wget https://znc.in/releases/znc-latest.tar.gz
Extract it.
tar -xzf znc-latest.tar.gz
cd znc-*
Compile:
./configure
make
sudo make install
Initial Configuration
Run:
znc --makeconf
The setup wizard asks questions such as:
- Username
- Password
- Listening port
- SSL support
- IRC network
- IRC nickname
- IRC server
- Channel list
Example:
Username: john
Password: ********
IRC Server: irc.libera.chat
Port: 6697
SSL: Yes
Nickname: JohnIRC
Channels: #linux #chat
After the wizard finishes, ZNC creates its configuration files automatically.
Starting ZNC
Launch ZNC:
znc
Run it in the background:
znc -d
Connecting Your IRC Client
Instead of connecting directly to an IRC server, connect your IRC client to your ZNC server.
Example:
Server: your-server.com
Port: 6697
Username: username/network
Password: yourpassword
SSL: Enabled
Your IRC client now connects to ZNC, and ZNC connects to the IRC network.
Web Administration
ZNC includes a built-in web interface for managing users, networks, and modules.
Open your browser and visit:
https://your-server:port/
From the web interface you can:
- Add IRC networks
- Change passwords
- Enable modules
- Configure channels
- View logs
- Manage users
Useful ZNC Modules
Some of the most popular modules include:
| Module | Description |
|---|---|
buffextras |
Improved playback features. |
chansaver |
Automatically saves joined channels. |
controlpanel |
Manage ZNC from IRC commands. |
log |
Log IRC conversations. |
perform |
Run commands automatically on connect. |
route_replies |
Route server replies correctly. |
simple_away |
Set away status automatically. |
webadmin |
Web-based administration interface. |
Loading Modules
From your IRC client:
/msg *status LoadMod log
List loaded modules:
/msg *status ListMods
Unload a module:
/msg *status UnloadMod log
Managing Networks
Add a network:
/msg *status AddNetwork Libera
Connect:
/msg *status Connect
Disconnect:
/msg *status Disconnect
List networks:
/msg *status ListNetworks
Playback Buffers
One of ZNC's best features is message buffering.
When disconnected:
- ZNC stays online.
- Messages are stored.
- You reconnect.
- Missed messages are replayed automatically.
This means you don't lose conversations while you're away.
Running ZNC as a Service
On systems using systemd:
systemctl --user enable znc
systemctl --user start znc
Check its status:
systemctl --user status znc
Security Best Practices
To secure your ZNC installation:
- Use SSL/TLS for client connections.
- Choose a strong administrator password.
- Keep ZNC updated.
- Restrict access with a firewall.
- Enable two-factor authentication if available through your authentication setup.
- Regularly back up your configuration.
Advantages of ZNC
- Maintains a persistent IRC connection.
- Never miss important messages.
- Connect from multiple devices.
- Supports multiple IRC networks.
- Includes a web administration interface.
- Lightweight and efficient.
- Extensible with modules.
- Open source and actively maintained.
Limitations
- Requires a server or VPS that is always online.
- Initial configuration can be more complex than a direct IRC connection.
- Message playback consumes some disk space over time if logging or large buffers are enabled.
Who Should Use ZNC?
ZNC is ideal for:
- IRC enthusiasts.
- Open-source contributors.
- System administrators.
- Developers.
- Community moderators.
- Anyone who wants a persistent IRC presence.
Conclusion
ZNC is one of the most popular IRC bouncers available, allowing you to stay connected to IRC networks around the clock. By acting as a persistent intermediary between your IRC client and the IRC server, it keeps your nickname online, stores missed messages, and lets you connect from multiple devices seamlessly.
Whether you are an occasional IRC user or manage several channels across multiple networks, ZNC provides a reliable and flexible way to improve your IRC experience. Its support for secure connections, multiple networks, message playback, and extensible modules makes it a valuable addition to any IRC setup.
Most Used ZNC Commands
ZNC is managed primarily through the *status pseudo-user. You send commands to *status from your IRC client using /msg *status <command>. These commands let you manage networks, modules, users, and your ZNC instance without leaving IRC.
Note: Some commands require administrator privileges. Available commands may vary depending on your ZNC version and installed modules.
Basic Commands
| Command | Description |
|---|---|
/msg *status Help |
Show all available commands. |
/msg *status Version |
Display the ZNC version. |
/msg *status ListAvailMods |
List available modules. |
/msg *status ListMods |
Show loaded modules. |
/msg *status LoadMod <module> |
Load a module. |
/msg *status UnloadMod <module> |
Unload a module. |
/msg *status ReloadMod <module> |
Reload a module. |
Network Management
List Networks
/msg *status ListNetworks
Shows all configured IRC networks.
Add a Network
/msg *status AddNetwork Libera
Creates a new IRC network named Libera.
Delete a Network
/msg *status DelNetwork Libera
Removes the specified network.
Connect to a Network
/msg *status Connect
Or specify a network:
/msg *status Connect Libera
Disconnect from a Network
/msg *status Disconnect
Server Management
Add an IRC Server
/msg *status AddServer irc.libera.chat +6697
The + before the port indicates an SSL/TLS connection.
Remove a Server
/msg *status DelServer irc.libera.chat +6697
List Servers
/msg *status ListServers
Displays all configured IRC servers for the current network.
Channel Management
Join a Channel
/msg *status Join #linux
Leave a Channel
/msg *status Part #linux
List Channels
/msg *status ListChans
Shows all configured channels.
Module Commands
List Available Modules
/msg *status ListAvailMods
