1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
.. highlight:: console
.. _Installation:
************
Installation
************
.. _Installation from a package_:
Installation from a package
===========================
Knot DNS may already be included in your operating system distribution and
therefore can be installed from packages (Linux), ports (BSD), or via
Homebrew (macOS). This is always preferred unless you want to test the latest
features, contribute to Knot development, or you know what you are doing.
See the project `download <https://www.knot-dns.cz/download>`_ page for
the latest information.
.. _Installation from source code:
Installation from source code
=============================
Required build environment
--------------------------
The build process relies on these standard tools:
* make
* libtool
* pkg-config
* autoconf >= 2.65
* python-sphinx (optional, for documentation building)
GCC >= 4.1 is mandatory for atomic built-ins, but the latest
available version is recommended. Another requirement is ``_GNU_SOURCE``
and C99 support, otherwise it adapts to the available compiler features.
LLVM clang compiler since version 2.9 can be used as well.
Getting the source code
-----------------------
You can find the source code for the latest release on `www.knot-dns.cz <https://www.knot-dns.cz>`_.
Alternatively, you can fetch the whole project from the git repository
`https://gitlab.nic.cz/knot/knot-dns.git <https://gitlab.nic.cz/knot/knot-dns>`_.
After obtaining the source code, compilation and installation is quite a
straightforward process using autotools.
.. _Configuring and generating Makefiles:
Configuring and generating Makefiles
------------------------------------
If compiling from 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
.. NOTE::
The compilation with enabled optimizations may take a long time. In such
a case the ``--disable-fastparser`` configure option can help.
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'``.
|