README 3.12 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
* gnutls >= 3.0
* jansson >= 2.3
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 liburcu-dev libgnutls28-dev libjansson-dev libedit-dev
44

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

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

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

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

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

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

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

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

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

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

91 92 93
Running
=======

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

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

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

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

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

Daniel Salzman's avatar
Daniel Salzman committed
117 118 119
For more information, refer to the user manual or:
$ knotc -h
$ knotd -h
The Gitter Badger's avatar
The Gitter Badger committed
120 121

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