.. highlight:: console .. _Installation: ************ Installation ************ .. _Required build environment: Required build environment ========================== GCC at least 4.1 is strictly required for atomic built-ins, but the latest available version is recommended. Another requirement is ``_GNU_SOURCE`` support, otherwise it adapts to the compiler available features. LLVM clang compiler can be used as well. However, the compilation with enabled optimizations will take a long time, unless the ``--disable-fastparser`` configure option is given. Knot DNS build system relies on these standard tools: * make * libtool * autoconf >= 2.65 .. _Required libraries: Required libraries ================== Knot DNS requires few libraries to be compiled: * GnuTLS, at least 3.3 * Jansson, at least 2.3 * Userspace RCU, at least 0.5.4 * libedit * lmdb (included) * libcap-ng, at least 0.6.4 (optional) * libidn (optional) * libsystemd (optional) * protobuf-c and fstrm (optional) The LMDB library is required. It is included with the Knot DNS source code, however linking with the system library is preferred. If the libcap-ng library is available, Knot DNS will take advantage of the POSIX 1003.1e :manpage:`capabilites(7)` by sandboxing the exposed threads. Most rights are stripped from the exposed threads for security reasons. The libidn library is a prerequisite for IDNA2003 (International Domain Names) support in Knot DNS utilities. If the libsystemd library is available, the server will use systemd's startup notifications mechanism and journald for logging. If the protobuf-c and fstrm libraries are available, the support for logging in Dnstap format will be included. .. _Installation from source code: Installation from source code ============================= You can find the source code for the latest release on `www.knot-dns.cz `_. Alternatively, you can fetch the whole project from the git repository `git://git.nic.cz/knot-dns.git `_. After obtaining the source code, the compilation and installation is a quite straightforward process using autotools. .. _Configuring and generating Makefiles: Configuring and generating Makefiles ------------------------------------ If compiling from the git source, you need to bootstrap the ``./configure`` file first:: $ autoreconf -i -f In most cases, you can just run configure without any options:: $ ./configure For all available configure options run:: $ ./configure --help Compilation ----------- After running ``./configure`` you can compile Knot DNS by running ``make`` command, which will produce binaries and other related files:: $ make Installation ------------ When you have finished building Knot DNS, it's time to install the binaries and configuration files into the operation system hierarchy. You can do so by executing:: $ make install When installing as a non-root user, you might have to gain elevated privileges by switching to root user, e.g. ``sudo make install`` or ``su -c 'make install'``. .. _OS specific installation: OS specific installation ======================== Knot DNS might already be available in the destination operating system repository. Debian Linux ------------ Knot DNS is already available from Debian 7 (Wheezy) upwards. In addition to the official packages we also provide custom repository, which can be used by adding:: deb http://deb.knot-dns.cz/debian/ main deb-src http://deb.knot-dns.cz/debian/ main to your ``/etc/apt/sources.list`` or into separate file in ``/etc/apt/sources.list.d/``. As an example, for Debian 8 (Jessie) the Knot DNS packages can be added by executing following command as the root user:: # cat >/etc/apt/sources.list.d/knot.list <