To create new wiki account, please join us on #znc at Libera.Chat and ask admins to create a wiki account for you. You can say thanks to spambots for this inconvenience.

Configuration: Difference between revisions

From ZNC
Jump to navigation Jump to search
>Jpnurmi
>Jpnurmi
Line 56: Line 56:
== Config file settings ==
== Config file settings ==


ZNC 1.6 configuration file consists of the following settings.
ZNC 1.6 configuration file consists of the following settings. All values are examples.


=== Global ===
=== Global ===


{| class="wikitable"
{| class="wikitable" style="width:100%"
|-
|-
! Key
| rowspan="2" style="width:20%" | '''AnonIPLimit'''
! Type
| Limits the number of unidentified connections per IP.
! Description
|-
|-
| '''AnonIPLimit'''
| <tt>AnonIPLimit = 10</tt>
| UInt
|-
| Limits the number of unidentified connections per IP.
| rowspan="2" | '''BindHost'''
| The list of allowed bindhosts. It is used by the [[webadmin]] module for users to select one. (Set different bindhosts in "Settings" on your Webadmin-Interface first - one per line - to make them appear in users configs afterwards)
|-
|-
| '''BindHost'''
| <tt>BindHost = 10.2.3.4<br/>BindHost = ...</tt>
| List
| This is a list of allowed bindhosts. It is used by the [[webadmin]] module for users to select one. (Set different bindhosts in "Settings" on your Webadmin-Interface first - one per line - to make them appear in users configs afterwards)
|-
|-
| '''ConnectDelay'''
| rowspan="2" | '''ConnectDelay'''
| UInt
| The time every connection will be delayed, in seconds. Some servers refuse your connection if you reconnect too fast. This affects the connection between ZNC and the IRC server; not the connection between your IRC client and ZNC.
| The time every connection will be delayed, in seconds. Some servers refuse your connection if you reconnect too fast. This affects the connection between ZNC and the IRC server; not the connection between your IRC client and ZNC.
|-
|-
| '''LoadModule'''
| <tt>ConnectDelay = 5</tt>
| List
|-
| Load a global [[Modules|module]] on startup.
| rowspan="2" | '''LoadModule'''
| Load global [[Modules|modules]] on startup.
|-
| <tt>LoadModule = webadmin<br/>LoadModule = modperl<br/>LoadModule = modpython</tt>
|-
|-
| '''MaxBufferSize'''
| rowspan="2" | '''MaxBufferSize'''
| UInt
| Sets the global Max Buffer Size a user can have.
| Sets the global Max Buffer Size a user can have.
|-
|-
| '''Motd'''
| <tt>MaxBufferSize = 500</tt>
| List
|-
| rowspan="2" | '''Motd'''
| The "message of the day" which is sent to clients on connect via notice from *status. Can be specified multiple times.
| The "message of the day" which is sent to clients on connect via notice from *status. Can be specified multiple times.
|-
|-
| '''PidFile'''
| <tt>Motd = ...<br/>Motd = ...</tt>
| String
|-
| rowspan="2" | '''PidFile'''
| Make ZNC write a pid file. ZNC does not need this itself. See [[FAQ#How_can_I_restart_ZNC_automatically_.28in_case_of_a_machine_reboot.2C_crash.2C_etc..29.3F|the FAQ]] on info how to crontab ZNC.
| Make ZNC write a pid file. ZNC does not need this itself. See [[FAQ#How_can_I_restart_ZNC_automatically_.28in_case_of_a_machine_reboot.2C_crash.2C_etc..29.3F|the FAQ]] on info how to crontab ZNC.
|-
|-
| '''ProtectedWebSessions'''
| <tt>PidFile = /home/znc/.znc/znc.pid</tt>
| Bool
| If set to <code>true</code>, IP changing during each web session is disallowed.
|-
|-
| '''ServerThrottle'''
| rowspan="2" | '''ProtectedWebSessions'''
| UInt
| Whether IP changing during each web session is disallowed.
|-
| <tt> ProtectedWebSessions = true</tt>
|-
| rowspan="2" | '''ServerThrottle'''
| The time between two connect attempts to the same hostname.
| The time between two connect attempts to the same hostname.
|-
|-
| '''Skin'''
| <tt>ServerThrottle = 30</tt>
| String
|-
| rowspan="2" | '''Skin'''
| The web interface skin.
| The web interface skin.
|-
|-
| '''SSLCertFile'''
| <tt>Skin = _default_</tt>
| String
| It's the TLS/SSL certificate file from which ZNC reads its server certificate.
|-
|-
| '''SSLCiphers'''
| rowspan="2" | '''SSLCertFile'''
| String
| The TLS/SSL certificate file from which ZNC reads its server certificate.
| Allowed SSL ciphers. For example <code>SSLCiphers = ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DS</code>
|-
|-
| '''StatusPrefix'''
| <tt>SSLCertFile = /home/znc/.znc/znc.pem</tt>
| String
|-
| rowspan="2" | '''SSLCiphers'''
| Allowed [https://www.openssl.org/docs/apps/ciphers.html SSL ciphers].
|-
| <tt>SSLCiphers = RC4:HIGH:!aNULL:!MD5</tt>
|-
| rowspan="2" | '''StatusPrefix'''
| The prefix for the status and module queries. This setting may be overwritten by users.
| The prefix for the status and module queries. This setting may be overwritten by users.
|-
|-
| '''TrustedProxy'''
| <tt>StatusPrefix = *</tt>
| List
|-
| rowspan="2" | '''TrustedProxy'''
| ...
| ...
|-
|-
| '''Version'''
| <tt>TrustedProxy = ...<br/>TrustedProxy = ...</tt>
| String
|-
| rowspan="2" | '''Version'''
| The ZNC version that wrote this file.
| The ZNC version that wrote this file.
|-
| <tt>Version = 1.6.0</tt>
|}
|}


Line 131: Line 142:
Definition of a port that ZNC should listen on.
Definition of a port that ZNC should listen on.


{| class="wikitable"
{| class="wikitable" style="width:100%"
|-
|-
! Key
| rowspan="2" style="width:20%" | '''AllowIRC'''
! Value
| Whether the port allows IRC connections.
! Description
|-
|-
| '''AllowIRC'''
| <tt>AllowIRC  = true</tt>
| <code>true</code>/<code>false</code>
| Whether the port allows IRC connections.
|-
|-
| '''AllowWeb'''
| rowspan="2" | '''AllowWeb'''
| <code>true</code>/<code>false</code>
| Whether the port allows web connections.
| Whether the port allows web connections.
|-
|-
| '''Host'''
| <tt>AllowWeb  = true</tt>
| eg. <code>10.2.3.4</code>
|-
| rowspan="2" | '''Host'''
| An optional host or IP on which ZNC listens.
| An optional host or IP on which ZNC listens.
|-
|-
| '''IPv4'''
| <tt>Host = 10.2.3.4</tt>
| <code>true</code>/<code>false</code>
|-
| rowspan="2" | '''IPv4'''
| Whether the port listens using IPv4.
| Whether the port listens using IPv4.
|-
|-
| '''IPv6'''
| <tt>IPv4 = true</tt>
| <code>true</code>/<code>false</code>
|-
| rowspan="2" | '''IPv6'''
| Whether the port listens using IPv6.
| Whether the port listens using IPv6.
|-
|-
| '''Port'''
| <tt>IPv6 = true</tt>
| <code>1025</code>-<code>65534</code>
|-
| rowspan="2" | '''Port'''
| The port number. WARNING: Some web browsers reject port 6667.
| The port number. WARNING: Some web browsers reject port 6667.
|-
|-
| '''SSL'''
| <tt>Port = 12345</tt>
| <code>true</code>/<code>false</code>
|-
| rowspan="2" | '''SSL'''
| Whether  this port is listening using SSL.
| Whether  this port is listening using SSL.
|-
|-
| '''URIPrefix'''
| <tt>SSL = true</tt>
| eg. <code>/znc/</code>
|-
| rowspan="2" | '''URIPrefix'''
| Prefix that ZNC should make the web interface available under. This can be used to make ZNC available behind a reverse proxy.
| Prefix that ZNC should make the web interface available under. This can be used to make ZNC available behind a reverse proxy.
|-
| <tt>URIPrefix = /znc/</tt>
|}
|}


Line 174: Line 189:
The user definition, you can have more than one. Each user may only connect to one network, so you need a separate user for each network. This is intended behavior! (See the [[FAQ]] about multiple networks)
The user definition, you can have more than one. Each user may only connect to one network, so you need a separate user for each network. This is intended behavior! (See the [[FAQ]] about multiple networks)


{| class="wikitable"
{| class="wikitable" style="width:100%"
|-
|-
! Key
| rowspan="2" style="width:20%" | '''Admin'''
! Type
| Whether the user has admin rights (e.g. in the [[webadmin]] module).
! Description
|-
|-
| '''Admin'''
| <tt>Admin = true</tt>
| Bool
| If set to <code>true</code>, the user has admin rights (e.g. in the [[webadmin]] module).
|-
|-
| '''Allow'''
| rowspan="2" | '''Allow'''
| List
| By default everyone is able to connect to ZNC as this user. With an ''Allow'' line you can restrict access to the specified IPs. Wildcards (*) are supported and multiple ''Allow'' lines can be set up.
| By default everyone is able to connect to ZNC as this user. With an ''Allow'' line you can restrict access to the specified IPs. Wildcards (*) are supported and multiple ''Allow'' lines can be set up.
|-
|-
| '''AltNick'''
| <tt>Allow = *</tt>
| String
|-
| rowspan="2" | '''AltNick'''
| The alternate nick ZNC will use if your main nick is in use.
| The alternate nick ZNC will use if your main nick is in use.
|-
|-
| '''AppendTimestamp'''
| <tt>AltNick = somebody_</tt>
| Bool
|-
| rowspan="2" | '''AppendTimestamp'''
| Whether to append the [[timestamps]] to the message or not
| Whether to append the [[timestamps]] to the message or not
|-
|-
| '''AutoClearChanBuffer'''
| <tt>AppendTimestamp = false</tt>
| Bool
|-
| rowspan="2" | '''AutoClearChanBuffer'''
| If set to <code>false</code>, it will buffer channels even while you are attached, and play the whole buffer back to you each time you connect. If set to <code>true</code>, it won't buffer channels while you are attached, and the buffer will be reset upon each playback.
| If set to <code>false</code>, it will buffer channels even while you are attached, and play the whole buffer back to you each time you connect. If set to <code>true</code>, it won't buffer channels while you are attached, and the buffer will be reset upon each playback.
|-
|-
| '''AutoClearQueryBuffer'''
| <tt>AutoClearChanBuffer = true</tt>
| Bool
| If set to <code>false</code>, it will buffer queries even while you are attached, and play the whole buffer back to you each time you connect. If set to <code>true</code>, it won't buffer queries while you are attached, and the buffer will be reset upon each playback.
|-
|-
| '''BindHost'''
| rowspan="2" | '''AutoClearQueryBuffer'''
| String
| If set to <code>false</code>, it will buffer queries even while you are attached, and play the whole buffer back to you each time you connect. If set to <code>true</code>, it won't buffer queries while you are attached, and the buffer will be reset upon each playback. See also [[query buffers]].
|-
| <tt>AutoClearQueryBuffer = true</tt>
|-
| rowspan="2" | '''BindHost'''
| ...
| ...
|-
|-
| '''Buffer'''
| <tt>BindHost = ...</tt>
| UInt
|-
| rowspan="2" | '''Buffer'''
| This is the amount of lines that the playback buffer will store before dropping off the oldest line. The buffers are stored in the memory by default.
| This is the amount of lines that the playback buffer will store before dropping off the oldest line. The buffers are stored in the memory by default.
|-
|-
| '''ChanModes'''
| <tt>Buffer = 300</tt>
| String
|-
| rowspan="2" | '''ChanModes'''
| Default modes ZNC will set when you join an empty channel.
| Default modes ZNC will set when you join an empty channel.
|-
|-
| '''ClientEncoding'''
| <tt>ChanModes = +stn</tt>
| String
|-
| rowspan="2" | '''ClientEncoding'''
| ...
| ...
|-
|-
| '''CTCPReply'''
| <tt>ClientEncoding = ...</tt>
| List
| A request-reply-pair for CTCP-requests. Format: <code><request> <reply></code>, e.g. <code>VERSION unknown v1.0</code>
|-
|-
| '''DCCBindHost'''
| rowspan="2" | '''CTCPReply'''
| String
| A request-reply-pair for CTCP-requests. Format: <code><request> <reply></code>.
|-
| <tt>CTCPReply = VERSION unknown v1.0</tt>
|-
| rowspan="2" | '''DCCBindHost'''
| ...
| ...
|-
|-
| '''DenyLoadMod'''
| <tt>DCCBindHost = ...</tt>
| Bool
|-
| rowspan="2" | '''DenyLoadMod'''
| If set to <code>true</code>, the user isn't able to load modules.
| If set to <code>true</code>, the user isn't able to load modules.
|-
|-
| '''DenySetBindHost'''
| <tt>DenyLoadMod = false</tt>
| Bool
|-
| rowspan="2" | '''DenySetBindHost'''
| If set to <code>true</code>, the user isn't able to change his vhost.
| If set to <code>true</code>, the user isn't able to change his vhost.
|-
|-
| '''Ident'''
| <tt>DenySetBindHost = false</tt>
| String
|-
| rowspan="2" | '''Ident'''
| ...  
| ...  
|-
|-
| '''JoinTries'''
| <tt>Ident = znc</tt>
| UInt
|-
| rowspan="2" | '''JoinTries'''
| How often should ZNC try to join if the first join failed, e.g. due to channel mode +i/+k or if you're banned.
| How often should ZNC try to join if the first join failed, e.g. due to channel mode +i/+k or if you're banned.
|-
|-
| '''LoadModule'''
| <tt>JoinTries = 10</tt>
| List
| Load a [[Modules|module]] for this user on startup.
|-
|-
| '''MaxJoins'''
| rowspan="2" | '''LoadModule'''
| UInt
| Load user [[Modules|modules]] on startup.
|-
| <tt>LoadModule = controlpanel<br/>LoadModule = chansaver</tt>
|-
| rowspan="2" | '''MaxJoins'''
| How many channels should ZNC join at once. Lower this if you get disconnected for 'Excess flood.
| How many channels should ZNC join at once. Lower this if you get disconnected for 'Excess flood.
|-
|-
| '''MaxNetworks'''
| <tt>MaxJoins = 3</tt>
| UInt
|-
| rowspan="2" | '''MaxNetworks'''
| Maximum number of networks a user is allowed to have.
| Maximum number of networks a user is allowed to have.
|-
|-
| '''MaxQueryBuffers'''
| <tt>MaxNetworks = 5</tt>
| UInt
|-
| rowspan="2" | '''MaxQueryBuffers'''
| Maximum number of query buffers that are stored. <code>0</code> is unlimited.
| Maximum number of query buffers that are stored. <code>0</code> is unlimited.
|-
|-
| '''MultiClients'''
| <tt>MaxQueryBuffers = 50</tt>
| Bool
|-
| rowspan="2" | '''MultiClients'''
| Set this to <code>true</code>, if you want to be able to connect with multiple clients at once.
| Set this to <code>true</code>, if you want to be able to connect with multiple clients at once.
|-
|-
| '''Nick'''
| <tt>MultiClients = true</tt>
| String
|-
| rowspan="2" | '''Nick'''
| Your primary nick.
| Your primary nick.
|-
|-
| '''PrependTimestamp'''
| <tt>Nick = somebody</tt>
| Bool
|-
| rowspan="2" | '''PrependTimestamp'''
| Whether to prepend the [[timestamps]] to the message or not
| Whether to prepend the [[timestamps]] to the message or not
|-
|-
| '''QuitMsg'''
| <tt>PrependTimestamp = true</tt>
| String
|-
| rowspan="2" | '''QuitMsg'''
| The default quit message ZNC will use when you jump servers or call shutdown.
| The default quit message ZNC will use when you jump servers or call shutdown.
|-
|-
| '''RealName'''
| <tt>QuitMsg = ZNC - http://znc.in</tt>
| String
|-
| rowspan="2" | '''RealName'''
| ...
| ...
|-
|-
| '''Skin'''
| <tt>Real Name = Got ZNC?</tt>
| String
|-
| rowspan="2" | '''Skin'''
| ...
| ...
|-
|-
| '''StatusPrefix'''
| <tt>Skin = _default_</tt>
| String
|-
| rowspan="2" | '''StatusPrefix'''
| The prefix for the status and module queries.
| The prefix for the status and module queries.
|-
|-
| '''TimestampFormat'''
| <tt>StatusPrefix = *</tt>
| String
| The format for the [[timestamps]] used in buffers, for example <code>[%H:%M:%S]</code>
|-
|-
| '''Timezone'''
| rowspan="2" | '''TimestampFormat'''
| String
| The format for the [[timestamps]] used in buffers, for example
| Set this to your local setting, so you'll get correct times in your [[timestamps]]. Format is Europe/Berlin, and is case sensitive, dropdown box will not work in IE.
|-
| <tt>TimestampFormat = [%H:%M:%S]</tt>
|-
| rowspan="2" | '''Timezone'''
| Set this to your local setting, so you'll get correct times in your [[timestamps]]. The format is case sensitive.
|-
| <tt>Timezone = Europe/Berlin</tt>
|}
|}


Line 301: Line 341:
The user definition, you can have more than one. Each user may only connect to one network, so you need a separate user for each network. This is intended behavior! (See the [[FAQ]] about multiple networks)
The user definition, you can have more than one. Each user may only connect to one network, so you need a separate user for each network. This is intended behavior! (See the [[FAQ]] about multiple networks)


{| class="wikitable"
{| class="wikitable" style="width:100%"
|-
|-
! Key
| rowspan="2" style="width:20%" | '''AltNick'''
! Type
| Overrides the '''AltNick''' setting in the User section.
! Description
|-
|-
| '''AltNick'''
| <tt>AltNick = somebody_</tt>
| String
| Overrides the '''AltNick''' setting in the User section.
|-
|-
| '''BindHost'''
| rowspan="2" | '''BindHost'''
| String
| Overrides the '''BindHost''' setting in the User section.
| Overrides the '''BindHost''' setting in the User section.
|-
|-
| '''Encoding'''
| <tt>BindHost = fake.doma.in</tt>
| String
|-
| rowspan="2" | '''Encoding'''
| ...
| ...
|-
|-
| '''FloodBurst'''
| <tt>Encoding = UTF-8</tt>
| Double
|-
| rowspan="2" | '''FloodBurst'''
| How many lines ZNC sends at once.
| How many lines ZNC sends at once.
|-
|-
| '''FloodRate'''
| <tt>FloodBurst = 4</tt>
| Double
|-
| rowspan="2" | '''FloodRate'''
| How many lines per second ZNC sends after the FloodBurst
| How many lines per second ZNC sends after the FloodBurst
|-
|-
| '''Ident'''
| <tt>FloodRate = 1.00</tt>
| String
|-
| rowspan="2" | '''Ident'''
| Overrides the '''Ident''' setting in the User section.
| Overrides the '''Ident''' setting in the User section.
|-
|-
| '''IRCConnectEnabled'''
| <tt>Ident = znc</tt>
| Bool
|-
| rowspan="2" | '''IRCConnectEnabled'''
| If set to <code>false</code>, user doesn't connect to IRC servers.
| If set to <code>false</code>, user doesn't connect to IRC servers.
|-
|-
| '''JoinDelay'''
| <tt>IRCConnectEnabled = false</tt>
| UInt
|-
| rowspan="2" | '''JoinDelay'''
| Defines the delay in seconds, until channels are joined after getting connected.
| Defines the delay in seconds, until channels are joined after getting connected.
|-
|-
| '''LoadModule'''
| <tt>JoinDelay = 0</tt>
| List
|-
| Load a [[Modules|module]] for this network on startup.
| rowspan="2" | '''LoadModule'''
| Load network [[Modules|modules]] on startup.
|-
| <tt>LoadModule = simple_away<br/>LoadModule = route_replies</tt>
|-
|-
| '''Nick'''
| rowspan="2" | '''Nick'''
| String
| Overrides the '''Nick''' setting in the User section.
| Overrides the '''Nick''' setting in the User section.
|-
|-
| '''QuitMsg'''
| <tt>Nick = somebody</tt>
| String
|-
| rowspan="2" | '''QuitMsg'''
| Overrides the '''QuitMsg''' setting in the User section.
| Overrides the '''QuitMsg''' setting in the User section.
|-
|-
| '''RealName'''
| <tt>QuitMsg = ZNC - http://znc.in</tt>
| String
|-
| rowspan="2" | '''RealName'''
| Overrides the '''RealName''' setting in the User section.
| Overrides the '''RealName''' setting in the User section.
|-
|-
| '''Server'''
| <tt>RealName = Got ZNC?</tt>
| List
|-
| Adds a server to the list of servers this user will be able to connect to. If you want ZNC to connect to the IRC server using SSL, put '+' in front of the port number. The IP can be IPv6. If the server requires a password, just add it as the third argument. Format: <code>Server = <IP-Address/Host> [+]<Port> [<Password>]</code>
| rowspan="2" | '''Server'''
| Adds a server to the list of servers this user will be able to connect to. If you want ZNC to connect to the IRC server using SSL, put '+' in front of the port number. The IP can be IPv6. If the server requires a password, just add it as the third argument.
|-
| <tt>Server = irc.freenode.net +6697</tt>
|}
|}


Line 364: Line 413:
Channels you want ZNC to join when connecting.
Channels you want ZNC to join when connecting.


{| class="wikitable"
{| class="wikitable" style="width:100%"
|-
|-
! Key
| rowspan="2" style="width:20%" | '''AutoClearChanBuffer'''
! Value
| Overrides the User-level '''AutoClearChanBuffer''' setting.
! Description
|-
|-
| '''AutoClearChanBuffer'''
| <tt>AutoClearChanBuffer = false</tt>
| <code>true</code>/<code>false</code>
| Overrides the User-level '''AutoClearChanBuffer''' setting.
|-
|-
| '''Buffer'''
| rowspan="2" | '''Buffer'''
| eg. <code>500</code>
| Overrides the User-level '''Buffer''' setting.
| Overrides the User-level '''Buffer''' setting.
|-
|-
| '''Detached'''
| <tt>Buffer = 100</tt>
| <code>true</code>/<code>false</code>
|-
| rowspan="2" | '''Detached'''
| Whether the channel is [[Detaching|detached]] ie. visible to clients.
| Whether the channel is [[Detaching|detached]] ie. visible to clients.
|-
|-
| '''Disabled'''
| <tt>Detached = true</tt>
| <code>true</code>/<code>false</code>
|-
| rowspan="2" | '''Disabled'''
| Whether ZNC joins the channel.
| Whether ZNC joins the channel.
|-
|-
| '''Key'''
| <tt>Disabled = true</tt>
| eg. <code>secret</code>
|-
| rowspan="2" | '''Key'''
| An optional channel key.
| An optional channel key.
|-
|-
| '''Modes'''
| <tt>Key = secret</tt>
| eg. <code>+stn</code>
|-
| rowspan="2" | '''Modes'''
| Overrides the User-level '''ChanModes''' setting.
| Overrides the User-level '''ChanModes''' setting.
|-
| <tt>Modes = +stn</tt>
|}
|}


Line 399: Line 450:
Used by the client to connect to ZNC. A hash may be generated using <code>znc --makepass</code>.
Used by the client to connect to ZNC. A hash may be generated using <code>znc --makepass</code>.


{| class="wikitable"
{| class="wikitable alternating" style="width:100%"
|-
|-
! Key
| rowspan="2" style="width:20%" | '''Hash'''
! Value
| The hash of a salted password.
! Description
|-
|-
| '''Hash'''
| <tt>Hash = 44ccdd8655fb2c9bf8e6026fc51dfeabfd3e361f696c9373c00a496a4dcaed6f</tt>
| eg. <code>746abef79c6259bf8...</code>
| Hash of salted password
|-
|-
| '''Method'''
| rowspan="2" | '''Method'''
| <code>sha256</code>
| The hashing method.
| The hashing method.
|-
|-
| '''Salt'''
| <tt>Method = sha256</tt>
| eg. <code>DhMI_/(iywC:/,cU+GKr</code>
|-
| Random 20 characters
| rowspan="2" | '''Salt'''
| Random 20 characters for salting the password.
|-
| <tt>Salt = ,e9a+t9WwSCjR_5:XAQu</tt>
|}
|}



Revision as of 20:21, 30 October 2014

Creating a config file

To generate a basic configuration file, run znc --makeconf after installation. It is NOT a good idea to create a new config file manually, please use znc --makeconf!

File locations

  • Configuration - ZNC gets its configuration by reading the file ~/.znc/configs/znc.conf.
  • Misc - Other files are also stored in the ~/.znc directory, such as the SSL certificate (znc.pem) and the PidFile (znc.pid).
  • Local Modules - Stored in ~/.znc/modules. ZNC will look in the local module directory first when trying to load a module.
  • Global Modules - Stored in /usr/local/lib/znc by default (where /usr/local is the prefix you chose). This is /usr/lib/znc if you used the Debian package.
  • Binaries - znc, znc-config, and znc-buildmod are all stored in /usr/local/bin (or in /usr/bin) by default. You can change this when you configure by using ./configure --prefix=/whatever/path/you/want.

Editing config

In most cases you should NOT edit znc.conf directly. Use webadmin instead.

If you really need to edit znc.conf by hand, do the following:

  1. pkill -SIGUSR1 znc
    to save current runtime configuration to znc.conf
  2. pkill znc
    to shutdown running ZNC instance
  3. Edit znc.conf
  4. znc
    to start it again with new configuration

Config file structure

The following pseudo content illustrates the config structure with single listener, user, network and channel. Naturally, there can be multiple instances of each.

Key = Value

<Listener name>
    Key = Value
</Listener>

<User name>
    Key = Value

    <Network name>
        Key = Value

        <Chan name>
            Key = Value
        </Chan>
    </Network>
    
    <Pass password>
        Key = Value
    </Pass>
</User>

Config file settings

ZNC 1.6 configuration file consists of the following settings. All values are examples.

Global

AnonIPLimit Limits the number of unidentified connections per IP.
AnonIPLimit = 10
BindHost The list of allowed bindhosts. It is used by the webadmin module for users to select one. (Set different bindhosts in "Settings" on your Webadmin-Interface first - one per line - to make them appear in users configs afterwards)
BindHost = 10.2.3.4
BindHost = ...
ConnectDelay The time every connection will be delayed, in seconds. Some servers refuse your connection if you reconnect too fast. This affects the connection between ZNC and the IRC server; not the connection between your IRC client and ZNC.
ConnectDelay = 5
LoadModule Load global modules on startup.
LoadModule = webadmin
LoadModule = modperl
LoadModule = modpython
MaxBufferSize Sets the global Max Buffer Size a user can have.
MaxBufferSize = 500
Motd The "message of the day" which is sent to clients on connect via notice from *status. Can be specified multiple times.
Motd = ...
Motd = ...
PidFile Make ZNC write a pid file. ZNC does not need this itself. See the FAQ on info how to crontab ZNC.
PidFile = /home/znc/.znc/znc.pid
ProtectedWebSessions Whether IP changing during each web session is disallowed.
ProtectedWebSessions = true
ServerThrottle The time between two connect attempts to the same hostname.
ServerThrottle = 30
Skin The web interface skin.
Skin = _default_
SSLCertFile The TLS/SSL certificate file from which ZNC reads its server certificate.
SSLCertFile = /home/znc/.znc/znc.pem
SSLCiphers Allowed SSL ciphers.
SSLCiphers = RC4:HIGH:!aNULL:!MD5
StatusPrefix The prefix for the status and module queries. This setting may be overwritten by users.
StatusPrefix = *
TrustedProxy ...
TrustedProxy = ...
TrustedProxy = ...
Version The ZNC version that wrote this file.
Version = 1.6.0

Listener

Definition of a port that ZNC should listen on.

AllowIRC Whether the port allows IRC connections.
AllowIRC = true
AllowWeb Whether the port allows web connections.
AllowWeb = true
Host An optional host or IP on which ZNC listens.
Host = 10.2.3.4
IPv4 Whether the port listens using IPv4.
IPv4 = true
IPv6 Whether the port listens using IPv6.
IPv6 = true
Port The port number. WARNING: Some web browsers reject port 6667.
Port = 12345
SSL Whether this port is listening using SSL.
SSL = true
URIPrefix Prefix that ZNC should make the web interface available under. This can be used to make ZNC available behind a reverse proxy.
URIPrefix = /znc/

User

The user definition, you can have more than one. Each user may only connect to one network, so you need a separate user for each network. This is intended behavior! (See the FAQ about multiple networks)

Admin Whether the user has admin rights (e.g. in the webadmin module).
Admin = true
Allow By default everyone is able to connect to ZNC as this user. With an Allow line you can restrict access to the specified IPs. Wildcards (*) are supported and multiple Allow lines can be set up.
Allow = *
AltNick The alternate nick ZNC will use if your main nick is in use.
AltNick = somebody_
AppendTimestamp Whether to append the timestamps to the message or not
AppendTimestamp = false
AutoClearChanBuffer If set to false, it will buffer channels even while you are attached, and play the whole buffer back to you each time you connect. If set to true, it won't buffer channels while you are attached, and the buffer will be reset upon each playback.
AutoClearChanBuffer = true
AutoClearQueryBuffer If set to false, it will buffer queries even while you are attached, and play the whole buffer back to you each time you connect. If set to true, it won't buffer queries while you are attached, and the buffer will be reset upon each playback. See also query buffers.
AutoClearQueryBuffer = true
BindHost ...
BindHost = ...
Buffer This is the amount of lines that the playback buffer will store before dropping off the oldest line. The buffers are stored in the memory by default.
Buffer = 300
ChanModes Default modes ZNC will set when you join an empty channel.
ChanModes = +stn
ClientEncoding ...
ClientEncoding = ...
CTCPReply A request-reply-pair for CTCP-requests. Format: <request> <reply>.
CTCPReply = VERSION unknown v1.0
DCCBindHost ...
DCCBindHost = ...
DenyLoadMod If set to true, the user isn't able to load modules.
DenyLoadMod = false
DenySetBindHost If set to true, the user isn't able to change his vhost.
DenySetBindHost = false
Ident ...
Ident = znc
JoinTries How often should ZNC try to join if the first join failed, e.g. due to channel mode +i/+k or if you're banned.
JoinTries = 10
LoadModule Load user modules on startup.
LoadModule = controlpanel
LoadModule = chansaver
MaxJoins How many channels should ZNC join at once. Lower this if you get disconnected for 'Excess flood.
MaxJoins = 3
MaxNetworks Maximum number of networks a user is allowed to have.
MaxNetworks = 5
MaxQueryBuffers Maximum number of query buffers that are stored. 0 is unlimited.
MaxQueryBuffers = 50
MultiClients Set this to true, if you want to be able to connect with multiple clients at once.
MultiClients = true
Nick Your primary nick.
Nick = somebody
PrependTimestamp Whether to prepend the timestamps to the message or not
PrependTimestamp = true
QuitMsg The default quit message ZNC will use when you jump servers or call shutdown.
QuitMsg = ZNC - http://znc.in
RealName ...
Real Name = Got ZNC?
Skin ...
Skin = _default_
StatusPrefix The prefix for the status and module queries.
StatusPrefix = *
TimestampFormat The format for the timestamps used in buffers, for example
TimestampFormat = [%H:%M:%S]
Timezone Set this to your local setting, so you'll get correct times in your timestamps. The format is case sensitive.
Timezone = Europe/Berlin

Network

The user definition, you can have more than one. Each user may only connect to one network, so you need a separate user for each network. This is intended behavior! (See the FAQ about multiple networks)

AltNick Overrides the AltNick setting in the User section.
AltNick = somebody_
BindHost Overrides the BindHost setting in the User section.
BindHost = fake.doma.in
Encoding ...
Encoding = UTF-8
FloodBurst How many lines ZNC sends at once.
FloodBurst = 4
FloodRate How many lines per second ZNC sends after the FloodBurst
FloodRate = 1.00
Ident Overrides the Ident setting in the User section.
Ident = znc
IRCConnectEnabled If set to false, user doesn't connect to IRC servers.
IRCConnectEnabled = false
JoinDelay Defines the delay in seconds, until channels are joined after getting connected.
JoinDelay = 0
LoadModule Load network modules on startup.
LoadModule = simple_away
LoadModule = route_replies
Nick Overrides the Nick setting in the User section.
Nick = somebody
QuitMsg Overrides the QuitMsg setting in the User section.
QuitMsg = ZNC - http://znc.in
RealName Overrides the RealName setting in the User section.
RealName = Got ZNC?
Server Adds a server to the list of servers this user will be able to connect to. If you want ZNC to connect to the IRC server using SSL, put '+' in front of the port number. The IP can be IPv6. If the server requires a password, just add it as the third argument.
Server = irc.freenode.net +6697

Chan

Channels you want ZNC to join when connecting.

AutoClearChanBuffer Overrides the User-level AutoClearChanBuffer setting.
AutoClearChanBuffer = false
Buffer Overrides the User-level Buffer setting.
Buffer = 100
Detached Whether the channel is detached ie. visible to clients.
Detached = true
Disabled Whether ZNC joins the channel.
Disabled = true
Key An optional channel key.
Key = secret
Modes Overrides the User-level ChanModes setting.
Modes = +stn

Pass

Used by the client to connect to ZNC. A hash may be generated using znc --makepass.

Hash The hash of a salted password.
Hash = 44ccdd8655fb2c9bf8e6026fc51dfeabfd3e361f696c9373c00a496a4dcaed6f
Method The hashing method.
Method = sha256
Salt Random 20 characters for salting the password.
Salt = ,e9a+t9WwSCjR_5:XAQu

Config file change history

Added in 1.6

  • SSLCiphers and TrustedProxy (Global)
  • URIPrefix (Listener)
  • AutoClearQueryBuffer, ClientEncoding, and MaxQueryBuffers (User)
  • Encoding, JoinDelay and QuitMsg (Network)
  • Disabled (Chan)

Added in 1.2

  • MaxJoins (User)

Older pre 1.x settings

  • DCCVHost - This is the IP address used for DCC bouncing.
  • BounceDCCs - If set to true, the DCCs will be bounced by ZNC.
  • DCCLookupMethod - If set to default, ZNC will use the IP the clients sends for the DCC connections; if set to client, ZNC will use the IP the client connects from.
  • Listener = [web_only|irc_only] [host or IP] [+]port - Configuration of listening port. Use web_only or irc_only, if you don't want port to be universal. Put host/IP before the port with a space between to bind to a specific IP (notice that in this case the listener can't listen on both ipv4 and ipv6). Then goes the port ZNC will listen on. If the port is prepended with a '+' (without space) then ZNC listens using SSL. You can have several listeners in one ZNC. (Introduced in 0.090, see next chapter for older versions)
  • Listener4 or Listener6 - Exactly the same as Listener, but will use only IPv4 or IPv6.
  • ISpoofFile - ZNC will write the ident of the user trying to connect to this file. Very useful if your shell supports oidentd.
  • ISpoofFormat - The format of the ISpoofFile.

Before 0.096

  • BindHost was named vHost

Before 0.090:

  • Listen was similar to Listener4 from last version, without irc_only/web_only support.
  • Listen6 was similar to Listener or Listener6 (depending on your OS) from last version, without irc_only/web_only support.
  • TODO: When did Listeners become their own substructure?