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

4 5 6
Knot DNS has several dependencies:
* libtool
* autoconf > 2.65
7
* liburcu >= 0.5.4
8 9 10
* gnutls >= 3.0
* jansson >= 2.3

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

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

Dependencies for building documentation:
20
* python-sphinx
21

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

Daniel Salzman's avatar
Daniel Salzman committed
25
Knot DNS may already be included in your operating system distribution and
26 27 28
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.
29 30 31

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

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

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

Daniel Salzman's avatar
Daniel Salzman committed
40
Install prerequisites:
41
$ sudo apt-get install \
42
  libtool autoconf liburcu-dev libgnutls28-dev libjansson-dev
43

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

47 48
Install optional packages:
$ sudo apt-get install libcap-ng-dev libsystemd-dev
49

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

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

Install prerequisites:
# yum install \
60
  libtool autoconf automake userspace-rcu-devel gnutls-devel jansson-devel
61

62
Install optional packages to override embedded libraries:
63
# yum install lmdb-devel
64

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

Daniel Salzman's avatar
Daniel Salzman committed
68 69 70 71
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
72
or newer is preferred. Clang supports atomics since version 2.9.
Daniel Salzman's avatar
Daniel Salzman committed
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87

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

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

90 91 92
Running
=======

93 94
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
95
Configuration file has to specify:
Daniel Salzman's avatar
Daniel Salzman committed
96 97 98
- storage for PID files, journal files etc.
- network interfaces
- served zones
Marek Vavrusa's avatar
Marek Vavrusa committed
99

Daniel Salzman's avatar
Daniel Salzman committed
100 101 102 103 104
E.g. use the default config file:
$ cd /etc/knot
$ mv knot.sample.conf knot.conf
Modify the config:
$ vim knot.conf
Marek Vavrusa's avatar
Marek Vavrusa committed
105

Daniel Salzman's avatar
Daniel Salzman committed
106 107
2) Prepare working directory
$ mv example.com.zone /var/lib/knot/
108

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

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

Daniel Salzman's avatar
Daniel Salzman committed
116 117 118
For more information, refer to the user manual or:
$ knotc -h
$ knotd -h