README 3.35 KB
Newer Older
1 2
Dependencies
============
3

4 5 6
Knot DNS has several dependencies:
* libtool
* autoconf > 2.65
7
* pkg-config
8
* liburcu >= 0.5.4
9
* gnutls >= 3.0
10
* libedit
11

12
Embedded libraries:
13
* lmdb               (system library is preferred)
14 15

Optional packages:
16
* libcap-ng >= 0.6.4 (for POSIX 1003.1e capabilities(7))
17
* libidn             (for IDNA2003 support in Knot utilities)
18
* libsystemd         (for systemd init system support)
19 20

Dependencies for building documentation:
21
* python-sphinx
22

Jan Mercl's avatar
Jan Mercl committed
23 24
Installation
============
25

Daniel Salzman's avatar
Daniel Salzman committed
26
Knot DNS may already be included in your operating system distribution and
27 28 29
therefore can be installed from packages (Linux), ports (BSD) or via
Homebrew (Mac). This is always preferred unless you want to test the latest
features, contribute to Knot development, or you just know what you are doing.
30 31 32

Following sections describe how to build Knot DNS from the source code.

Daniel Salzman's avatar
Daniel Salzman committed
33
1) Install prerequisites
Jan Mercl's avatar
Jan Mercl committed
34

Daniel Salzman's avatar
Daniel Salzman committed
35 36 37
Debian based distributions
--------------------------
Update the system:
Jan Mercl's avatar
Jan Mercl committed
38 39
$ sudo apt-get update
$ sudo apt-get upgrade
40

Daniel Salzman's avatar
Daniel Salzman committed
41
Install prerequisites:
42
$ sudo apt-get install \
43
  libtool autoconf make pkg-config liburcu-dev libgnutls28-dev libedit-dev
44

45
Install optional packages to override embedded libraries:
46
$ sudo apt-get install liblmdb-dev
47

48
Install optional packages:
49
$ sudo apt-get install libcap-ng-dev libsystemd-dev libidn11-dev protobuf-c-compiler libfstrm-dev
50

Daniel Salzman's avatar
Daniel Salzman committed
51 52
Fedora like distributions
-------------------------
53
Update the system:
54
# dnf upgrade
55

56
Install basic development tools:
57
# dnf install @buildsys-build
58 59

Install prerequisites:
60
# dnf install \
61
  libtool autoconf pkgconfig automake userspace-rcu-devel gnutls-devel libedit-devel
62

63
Install optional packages to override embedded libraries:
64
# dnf install lmdb-devel
65

Daniel Salzman's avatar
Daniel Salzman committed
66
Install optional packages:
67
# dnf install libcap-ng-devel systemd-devel libidn-devel protobuf-c-devel fstrm-devel
68

69 70 71 72
When compiling on RHEL based system, the Fedora EPEL repository has to be
enabled. Also for RHEL 6, forward compatibility package gnutls30-devel
with newer GnuTLS is required instead of gnutls-devel.

Daniel Salzman's avatar
Daniel Salzman committed
73 74 75 76
2) Install Knot DNS

Knot DNS requires compiler to support atomic intrinsics.
GCC version at least 4.1 supports legacy atomic builtins, however 4.7
77
or newer is preferred. Clang supports atomics since version 2.9.
Daniel Salzman's avatar
Daniel Salzman committed
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92

Get the source code:
$ git clone git://git.nic.cz/knot-dns.git
Or extract source package to knot-dns directory

Compile Knot
$ cd knot-dns
$ autoreconf -if
$ ./configure
$ make

Install Knot DNS into system:
$ sudo make install
$ sudo ldconfig

93
NOTE: If you want to reduce zscanner compile time, use configure option --disable-fastparser.
94

95 96 97
Running
=======

98 99
1) Each server needs configuration file. Please see samples/knot.sample.conf,
project documentation, or man 5 knot.conf for more details.
Jan Kadlec's avatar
Jan Kadlec committed
100
Configuration file has to specify:
Daniel Salzman's avatar
Daniel Salzman committed
101 102 103
- storage for PID files, journal files etc.
- network interfaces
- served zones
Marek Vavrusa's avatar
Marek Vavrusa committed
104

Daniel Salzman's avatar
Daniel Salzman committed
105 106 107 108
E.g. use the default config file:
$ cd /etc/knot
$ mv knot.sample.conf knot.conf
Modify the config:
109
$ editor knot.conf
Marek Vavrusa's avatar
Marek Vavrusa committed
110

Daniel Salzman's avatar
Daniel Salzman committed
111 112
2) Prepare working directory
$ mv example.com.zone /var/lib/knot/
113

Daniel Salzman's avatar
Daniel Salzman committed
114
3) Start the server. This can be done by running the 'knotd' command.
Daniel Salzman's avatar
Daniel Salzman committed
115 116
Alternatively, your distribution should have an init script available, if you've
installed Knot using a binary package.
117

118
Start Knot in the foreground to see if it runs:
Daniel Salzman's avatar
Daniel Salzman committed
119
$ knotd -c myserver.conf
Jan Kadlec's avatar
Jan Kadlec committed
120

Daniel Salzman's avatar
Daniel Salzman committed
121 122 123
For more information, refer to the user manual or:
$ knotc -h
$ knotd -h
The Gitter Badger's avatar
The Gitter Badger committed
124 125

Join the chat at https://gitter.im/CZ-NIC/knot