installation.rst 7.43 KB
Newer Older
1 2
.. _Knot DNS Installation:

3 4 5 6
*********************
Knot DNS Installation
*********************

7
.. _Required build environment:
8

9 10
Required build environment
==========================
11

12 13 14 15 16 17 18
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.
19 20 21 22 23 24 25 26 27

Knot DNS build system relies on these standard tools:

* make
* libtool
* autoconf >= 2.65
* flex >= 2.5.31
* bison >= 2.3

28 29
.. _Required libraries:

30 31 32 33 34
Required libraries
==================

Knot DNS requires few libraries to be compiled:

Daniel Salzman's avatar
Daniel Salzman committed
35
* OpenSSL, at least 1.0.0 (1.0.1 is required for ECDSA)
36 37 38 39 40 41 42 43 44 45 46 47
* zlib
* Userspace RCU, at least 0.5.4
* libcap-ng, at least 0.6.4 (optional library)

If libcap-ng library is available, Knot DNS will take advantage of the
POSIX 1003.1e capabilites(7) by sandboxing the exposed threads.  Most
rights are stripped from the exposed threads for security reasons.

You can probably find OpenSSL and zlib libraries already included in
your system or distribution.  If not, zlib resides at http://zlib.net,
and OpenSSL can be found at http://www.openssl.org.

48 49
.. _Userspace RCU:

50 51 52 53 54 55 56 57
Userspace RCU
-------------

liburcu is a LGPLv2.1 userspace RCU (read-copy-update) library. This
data synchronization library provides read-side access which scales
linearly with the number of cores. It does so by allowing multiple
copies of a given data structure to live at the same time, and by
monitoring the data structure accesses to detect grace periods after
Jan Včelák's avatar
Jan Včelák committed
58
which memory reclamation is possible.  `Userspace RSU <http://lttng.org/urcu>`_
59 60 61 62 63 64 65 66 67 68

Binary packages for Debian can be found under ``liburcu1`` for the
library and ``liburcu-dev`` for development files.

Minimum supported version of Userspace RCU library is 0.5.4,
but we recommend using latest available version.
It is crucial especially on non-Linux systems, as we got some compatibility
patches accepted to later releases of Userspace RCU.
OpenBSD, NetBSD and OS X platforms are supported from version 0.7.0.

69 70
.. _Installation from the source:

71 72 73
Installation from the sources
=============================

Jan Včelák's avatar
Jan Včelák committed
74
You can find the source files for the latest release on `www.knot-dns.cz <https://www.knot-dns.cz>`_.
75 76
Alternatively, you can fetch the sources from git repository
`git://git.nic.cz/knot-dns.git <https://gitlab.labs.nic.cz/labs/knot/tree/master>`_.
77 78 79 80

After unpacking the sources, the compilation and installation is a
quite straightforward process using autotools.

81 82
.. _Configuring and generating Makefiles:

83 84 85
Configuring and generating Makefiles
------------------------------------

86
If you want to compile from Git sources, you need to bootstrap the ``./configure`` file first::
87 88 89

    $ autoreconf -i -f

90 91 92 93
In most cases you can just run configure without any options::

    $ ./configure

94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
For all available configure options run::

    $ ./configure --help

If you have trouble with unknown syscalls under valgrind, disable recvmmsg by
adding a parameter ``--enable-recvmmsg=no`` to configure.

Knot DNS has also support for link time optimizations.  You can enable
it by the configure parameter ``./configure --enable-lto=yes``.  It is
however disabled by default as it is known to be broken in some
compiler versions and may result in an unexpected behaviour.  Link
time optimizations also disables the possibility to debug the
resulting binaries.

If you want to add debug messages, there are two steps to do that.
First you have to enable modules you are interested in.
Available are: ``server, zones, xfr, packet, dname, rr, ns, hash, compiler``.
You can combine multiple modules as a comma-separated list.
Then you can narrow the verbosity of the debugging message by specifying the
verbosity as ``brief, verbose, details``.

For example::

    $ ./configure --enable-debug=server,packet --enable-debuglevel=verbose

119
For more detailed information, see :ref:`Debug messages`.
120 121 122 123

Compilation
-----------

124
After running ``./configure`` you can compile Knot DNS by running
125 126 127 128 129 130
``make`` command, which will produce binaries and other related
files::

    $ make

Knot DNS build process is safe to parallelize using ``make -j N``,
131 132
where N is a number of concurrent processes. Using this the compilation speed
can be increased.
133 134 135 136

Installation
------------

137
When you have finished building Knot DNS, it's time to install the
138
binaries and configuration files into the operation system hierarchy.
139
You can do so by executing::
140 141 142

    $ make install

143 144 145
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'``.

146 147 148
Installation from packages
==========================

149
In addition to providing the packages in .DEB and .RPM format,
150 151 152 153 154 155 156 157 158 159
Knot DNS might already be available in your favourite distribution, or
in a ports tree.

Installing Knot DNS packages on Debian
--------------------------------------

Knot DNS is already available from Debian wheezy upwards.  In addition
to the official packages we also provide custom repository, which can
be used by adding::

160 161
    deb     http://deb.knot-dns.cz/debian/ <codename> main
    deb-src http://deb.knot-dns.cz/debian/ <codename> main
162 163 164 165

to your ``/etc/apt/sources.list`` or into separate file in
``/etc/apt/sources.list.d/``.

166 167
As an example, for Debian wheezy the Knot DNS packages can be added by
executing following command as the root user::
168 169

    $ cat >/etc/apt/sources.list.d/knot.list <<EOF
170 171
    deb     http://deb.knot-dns.cz/debian/ wheezy main
    deb-src http://deb.knot-dns.cz/debian/ wheezy main
172 173 174 175 176 177 178
    EOF
    $ apt-get update
    $ apt-get install knot

Installing Knot DNS packages on Ubuntu
--------------------------------------

179
Prepackaged version of Knot DNS can be found in Ubuntu from
180 181
version 12.10 (Quantal Quetzal).  In addition to the package included
in the main archive, we provide Personal Package Archive (PPA) as an
182
option to upgrade to the last stable version of Knot DNS or to install
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202
it on older versions of Ubuntu Linux.

Adding official PPA repository for Knot DNS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

To start installing and using software from a Personal Package
Archive, you first need to tell Ubuntu where to find the PPA::

    $ sudo add-apt-repository ppa:cz.nic-labs/knot-dns
    $ sudo apt-get update
    $ sudo apt-get install knot

Running this sequence of commands will ensure that you will
install Knot DNS on your system and keep it up-to-date
in the future, when new versions are released.

Installing Knot DNS packages on Fedora
--------------------------------------

The RPM packages for ``Knot DNS`` are available in official Fedora
203 204 205
repositories since Fedora 18 (Spherical Cow). Look for ``knot``
package in your package manager. To install the package using Yum, run
a following command as the root user::
206

207
    $ yum install knot
208 209 210 211 212 213 214 215 216 217 218 219

Installing Knot DNS from ports on FreeBSD
-----------------------------------------

Knot DNS is in ports tree under ``dns/knot``::

    $ cd /usr/ports/dns/knot
    $ sudo make install

Installing Knot DNS on Arch Linux
---------------------------------

220 221 222
Knot DNS is available official package repository (AUR)::

    https://aur.archlinux.org/packages/knot/
223 224 225 226

Installing Knot DNS on Gentoo Linux
-----------------------------------

227 228 229
Knot DNS is available from Gentoo package repository::

    https://packages.gentoo.org/package/net-dns/knot