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

Configuration

From ZNC
Revision as of 20:21, 30 October 2014 by Jpnurmi (talk) (Config file settings)
Jump to: navigation, search

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?