installation.rst 2.63 KB
Newer Older
1
.. highlight:: console
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

21
.. _Installation from the source code:
22

23 24
Installation from the 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
`git://git.nic.cz/knot-dns.git <https://gitlab.labs.nic.cz/knot/knot-dns/tree/master>`_.
48

49
After obtaining the source code, the compilation and installation is a
50 51
quite straightforward process using autotools.

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::
62 63 64

    $ ./configure

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

    $ ./configure --help

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

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
------------

85
When you have finished building Knot DNS, it's time to install the
86
binaries and configuration files into the operation system hierarchy.
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
92
switching to root user, e.g. ``sudo make install`` or ``su -c 'make install'``.