README 4.46 KB
Newer Older
Jan Mercl's avatar
Jan Mercl committed
1 2
Installation
============
3

Jan Mercl's avatar
Jan Mercl committed
4
The following steps should work (verified in VirtualBox only)
5
on the distribution/architecture/release combinations as listed bellow.
Jan Mercl's avatar
Jan Mercl committed
6

7 8 9 10 11
----------------------------------------------
Debian         (AMD64, I386) 6.0.2.1 (squeeze)
Ubuntu Server  (AMD64, I386) 10.04 LTS
Ubuntu Desktop (AMD64, I386) 10.04 LTS
----------------------------------------------
Jan Mercl's avatar
Jan Mercl committed
12 13 14 15 16 17

$ # make the system up-to-date
$
$ sudo apt-get update
$ sudo apt-get upgrade
$
18
$ # ensure all prerequisites are installed
Jan Mercl's avatar
Jan Mercl committed
19
$
20
$ sudo apt-get install git-core autoconf libtool flex bison libssl-dev libev-dev
Jan Mercl's avatar
Jan Mercl committed
21
$
22
$ # the required version of liburcu is not available in the default package sources.
Jan Mercl's avatar
Jan Mercl committed
23
$
24 25
$ wget http://bd.archive.ubuntu.com/ubuntu/pool/universe/libu/liburcu/liburcu0_0.5.4-1_amd64.deb
$ wget http://bd.archive.ubuntu.com/ubuntu/pool/universe/libu/liburcu/liburcu-dev_0.5.4-1_amd64.deb
Jan Mercl's avatar
Jan Mercl committed
26 27
$ sudo dpkg -i liburcu0_0.5.4-1_amd64.deb
$ sudo dpkg -i liburcu-dev_0.5.4-1_amd64.deb
Jan Mercl's avatar
Jan Mercl committed
28 29 30
$
$ # go for the real thing
$
31 32 33 34
$ git clone git://git.nic.cz/knot
$ cd knot
$ autoreconf -if
$ ./configure
Marek Vavrusa's avatar
Marek Vavrusa committed
35
$ make
36 37
$ sudo make install
$ sudo ldconfig
Jan Mercl's avatar
Jan Mercl committed
38

39
Alternative packages for I386:
Jan Mercl's avatar
Jan Mercl committed
40

41
$ # the required version of liburcu is not available in the default package sources.
Jan Mercl's avatar
Jan Mercl committed
42 43 44 45 46
$
$ wget http://bd.archive.ubuntu.com/ubuntu/pool/universe/libu/liburcu/liburcu0_0.5.4-1_i386.deb
$ wget http://bd.archive.ubuntu.com/ubuntu/pool/universe/libu/liburcu/liburcu-dev_0.5.4-1_i386.deb
$ sudo dpkg -i liburcu0_0.5.4-1_i386.deb
$ sudo dpkg -i liburcu-dev_0.5.4-1_i386.deb
47

48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
Installation on BSD
===================

Not all prerequisites are available as ports on BSD.

- liburcu must be compiled from sources
  - version 0.6.4 compiles on BSD without any source code modifications

Knot requires more recent version of flex from ports, to prevent name clash, specify flex destination.
$ cd <knot sources>
$ autoreconf -if
$ LEX_R=/usr/local/bin/flex ./configure
$ make && sudo make install

Installation on OS X
====================

Not all prerequisites are preinstalled for OS X.

- liburcu must be compiled from sources
  - liburcu requires gcc-4.6 from MacPorts, as it depends on __thread keyword
  $ CC=gcc-mp-4.6 ARCH=x86_64 ./configure
  $ make && sudo make install

Compiling Knot with gcc-mp-4.6 is recommended, but not necessary. 

74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
Running
=======

First, each server needs configuration file. Please see samples/knot.sample.conf
for reference. Minimal configuration can be found in samples/knot.min.conf
Configuration zone has to specify:
* storage for PID files, compiled zones etc.
* network interfaces
* served zones

$ cp samples/knot.min.conf myserver.conf
$ vim myserver.conf # or your favourite text editor

Second, zone files have to be compiled to binary form in order for server to
load them. Binary 'knotc' (controller) offers functionality for everything from zone file
management to controlling server instance. Most important parameter is '-c' that
specifies config file for our server. Compiled zones are saved to storage
defined in 'storage' variable in configuration.

$ knotc -h # see what it can do
$ knotc -c myserver.conf compile # compile zone files to binary format

Third, lets load server. You can do this by running 'knotd' directly, or with
'knotc' as well. Server is able to run in daemonized or interactive mode.
Lets start our server in interactive mode (parameter '-i') to see if it runs.

$ knotc -c myserver.conf -i start # start server in interactive mode

Running as daemon
=================

Controller runs server in daemonized mode as default. Disadvantage is, that
it closes stdout/stderr so you need to set up either syslog or logging to
own files in the configuration. Controller parameter '-w' waits for the operation
to finish. Let's test server functionality.

$ knotc -c myserver.conf -w start # start server
$ dig @$ADDR -p $PORT example.com # issue a query and see result
$ ...
$ knotc -c myserver.conf -w stop  # stop server

Also, keep in mind that zone files have to be compiled before they are loaded
to server. Workflow is as follows:

$ knotc -c myserver.conf -w start
$ <edit zonefile>
$ knotc -c myserver.conf compile  # compile zones to binary format
$ knotc -c myserver.conf reload   # reconfigures server on-the-fly
$ dig @$ADDR -p $PORT example.com # issue a query and see result
$ ...
$ knotc -c myserver.conf stop

Supported features
==================

DNS functions:
* AXFR (master)
* EDNS0
* DNSSEC
* NSEC3

Server features:
* Adding/removing zones on-the-fly
* Reconfiguring server instance on-the-fly
* IPv6 support
* Semantic checks of loaded zone