installation.rst 2.62 KB
Newer Older
1
.. highlight:: console
Daniel Salzman's avatar
Daniel Salzman committed
2
.. _Installation:
3

4 5 6
************
Installation
************
7

8
.. _Installation from a package_:
9

10 11
Installation from a package
===========================
12

13 14 15 16
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 just know what you are doing.
17

18 19
See the project `download <https://www.knot-dns.cz/download>`_ page for
the latest information.
20

Zuzana Lena Ansorgova's avatar
Zuzana Lena Ansorgova committed
21
.. _Installation from source code:
22

Zuzana Lena Ansorgova's avatar
Zuzana Lena Ansorgova committed
23 24
Installation from source code
=============================
25

26 27
Required build environment
--------------------------
28

29
The build process relies on these standard tools:
30

31 32 33 34 35
* make
* libtool
* pkg-config
* autoconf >= 2.65
* python-sphinx (optional, for documentation building)
36

37 38 39 40
GCC at least 4.1 is strictly required for atomic built-ins, but the latest
available version is recommended. Another requirements ``_GNU_SOURCE``
and C99 support, otherwise it adapts to the compiler available features.
LLVM clang compiler since version 2.9 can be used as well.
41

42 43
Getting the source code
-----------------------
44

45 46
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
47
`https://gitlab.labs.nic.cz/knot/knot-dns.git <https://gitlab.labs.nic.cz/knot/knot-dns>`_.
48

Zuzana Lena Ansorgova's avatar
Zuzana Lena Ansorgova committed
49 50
After obtaining the source code, compilation and installation is a quite
straightforward process using autotools.
51

52 53
.. _Configuring and generating Makefiles:

54 55 56
Configuring and generating Makefiles
------------------------------------

57
If compiling from the git source, you need to bootstrap the ``./configure`` file first::
58 59 60

    $ autoreconf -i -f

61
In most cases, you can just run configure without any options::
Daniel Salzman's avatar
Daniel Salzman committed
62 63 64

    $ ./configure

65 66 67 68 69 70 71
For all available configure options run::

    $ ./configure --help

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

Daniel Salzman's avatar
Daniel Salzman committed
72
After running ``./configure`` you can compile Knot DNS by running
73 74 75 76 77
``make`` command, which will produce binaries and other related
files::

    $ make

78 79 80 81
.. NOTE::
   The compilation with enabled optimizations may take a long time. In such
   a case the ``--disable-fastparser`` configure option can help.

82 83 84
Installation
------------

Daniel Salzman's avatar
Daniel Salzman committed
85
When you have finished building Knot DNS, it's time to install the
86
binaries and configuration files into the operation system hierarchy.
Daniel Salzman's avatar
Daniel Salzman committed
87
You can do so by executing::
88 89 90

    $ make install

91
When installing as a non-root user, you might have to gain elevated privileges by
Daniel Salzman's avatar
Daniel Salzman committed
92
switching to root user, e.g. ``sudo make install`` or ``su -c 'make install'``.