Commit ee2a4bf4 authored by Daniel Salzman's avatar Daniel Salzman

Merge branch 'sphinx'

Conflicts:
	doc/installation.texi
	doc/running.texi
parents 35d4fe12 874db9c6
......@@ -77,3 +77,7 @@
# alternative allocators
/src/allocator.h
/src/allocators/
# sphinx documentation
/doc/_build/
/doc/conf.py
......@@ -339,6 +339,21 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sched.h>]], [[cpuset_t* set = cpuset
# Add code coverage macro
AX_CODE_COVERAGE
AC_PATH_PROG([SPHINXBUILD], [sphinx-build], [false])
AS_IF([test "$SPHINXBUILD" = "false"],
[AC_MSG_WARN([Could not find the 'sphinx-build' executable, you will be unable to regenerate documentation.])],
[AC_PATH_PROG([PDFLATEX], [pdflatex], [false])
AS_IF([test "$PDFLATEX" = ""],
[AC_MSG_WARN([Could not find the 'pdflatex' executable, you will be unable to generate PDF documentation.])])
AC_PATH_PROG([MAKEINFO], [makeinfo], [false])
AS_IF([test "$MAKEINFO" = "false"],
[AC_MSG_WARN([Could not find the 'makeinfo' executable, you will be unable to generate info documentation.])])
])
AM_CONDITIONAL([HAVE_SPHINXBUILD], test "$SPHINXBUILD" != "false")
AM_CONDITIONAL([HAVE_PDFLATEX], test "$PDFLATEX" != "false")
AM_CONDITIONAL([HAVE_MAKEINFO], test "$MAKEINFO" != "false")
AC_CONFIG_FILES([Makefile
doc/Makefile
man/Makefile
......@@ -348,6 +363,7 @@ AC_CONFIG_FILES([Makefile
src/Makefile
tests/Makefile
src/zscanner/Makefile
doc/conf.py
man/khost.1
man/knotc.8
man/knotd.8
......
......@@ -15,3 +15,4 @@ texinfo.tex
version.texi
mdate-sh
stamp-vti
!/logo.pdf
\ No newline at end of file
info_TEXINFOS = knot.texi
knot_TEXINFOS = \
configuration.texi \
indices.texi \
installation.texi \
introduction.texi \
knot.texi \
migration.texi \
reference.texi \
requirements.texi \
running.texi \
security.texi \
synth_record.texi \
troubleshooting.texi \
version.texi
SPHINXBUILDDIR = _build
ALLSPHINXOPTS = -d $(SPHINXBUILDDIR)/doctrees -D latex_paper_size=a4 $(SPHINXOPTS) .
.PHONY: help html dirhtml singlehtml pdf info doctest
if HAVE_SPHINXBUILD
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(SPHINXBUILDDIR)/html."
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(SPHINXBUILDDIR)/dirhtml."
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(SPHINXBUILDDIR)/singlehtml."
if HAVE_PDFLATEX
pdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(SPHINXBUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(SPHINXBUILDDIR)/latex."
else
pdf:
@echo "You need to install pdflatex and re-run configure to be"
@echo "able to generate PDF documentation."
endif
if HAVE_MAKEINFO
info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(SPHINXBUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(SPHINXBUILDDIR)/texinfo."
else
@echo "You need to install GNU Texinfo and re-run configure to be"
@echo "able to generate info pages."
endif
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(SPHINXBUILDDIR)/doctest/output.txt."
else
html pdf info doctest:
@echo "Please install sphinx (python-sphinx) to generate Knot DNS documentation."
endif
clean-local:
-rm -rf _build
# -*- coding: utf-8 -*-
#
# Knot DNS documentation build configuration file, created by
# sphinx-quickstart on Tue Apr 15 13:48:28 2014.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys, os, time
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General configuration -----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = []
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The encoding of source files.
#source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'Knot DNS'
copyright = "%d, CZ.NIC, z.s.p.o." % time.localtime().tm_year
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '@VERSION@'
# The full version, including alpha/beta/rc tags.
release = '@VERSION@'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
today = '@RELEASE_DATE@'
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']
# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# -- Options for HTML output ---------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'nature'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
html_logo = 'logo.png'
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
#html_static_path = ['_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
html_domain_indices = False
# If false, no index is generated.
html_use_index = False
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'KnotDNSdoc'
# -- Options for LaTeX output --------------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
# No empty pages between chapters
'classoptions': ',openany,oneside',
# Language preferences
'babel': '\\usepackage[english]{babel}',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'KnotDNS.tex', u'Knot DNS Documentation',
u'CZ.NIC, z.s.p.o.', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
latex_logo = 'logo.pdf'
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# If true, show URL addresses after external links.
#latex_show_urls = False
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
latex_domain_indices = False
# -- Options for manual page output --------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
#man_pages = [
# ('index', 'knotdns', u'Knot DNS Documentation',
# [u'CZ.NIC, z.s.p.o.'], 1)
#]
# If true, show URL addresses after external links.
#man_show_urls = False
# -- Options for Texinfo output ------------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'KnotDNS', u'Knot DNS Documentation',
u'CZ.NIC, z.s.p.o.', 'KnotDNS',
'High-performance authoritative DNS server implementation',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
#texinfo_appendices = []
# If false, no module index is generated.
#texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'
This diff is collapsed.
This diff is collapsed.
Welcome to Knot DNS's documentation!
====================================
.. toctree::
:maxdepth: 2
introduction
requirements
installation
configuration
running
troubleshooting
reference
migration
@node Statement Index, Knot DNS Configuration Reference, Troubleshooting, Top
@unnumbered Statement Index
@printindex st
.. _Knot DNS Installation:
*********************
Knot DNS Installation
*********************
.. _Required build environment:
Required build environment
==========================
GCC at least 4.1 is strictly required for atomic built-ins, but 4.2 or
newer is recommended. Another requirement is ``_GNU_SOURCE`` support,
otherwise it adapts to the compiler available features. LLVM clang
works, but it is not officially supported.
Knot DNS build system relies on these standard tools:
* make
* libtool
* autoconf >= 2.65
* flex >= 2.5.31
* bison >= 2.3
.. _Required libraries:
Required libraries
==================
Knot DNS requires few libraries to be compiled:
* OpenSSL, at least 1.0.0 (1.0.1 is required for ECDSA)
* zlib
* Userspace RCU, at least 0.5.4
* libcap-ng, at least 0.6.4 (optional library)
If libcap-ng library is available, Knot DNS will take advantage of the
POSIX 1003.1e capabilites(7) by sandboxing the exposed threads. Most
rights are stripped from the exposed threads for security reasons.
You can probably find OpenSSL and zlib libraries already included in
your system or distribution. If not, zlib resides at http://zlib.net,
and OpenSSL can be found at http://www.openssl.org.
.. _Userspace RCU:
Userspace RCU
-------------
liburcu is a LGPLv2.1 userspace RCU (read-copy-update) library. This
data synchronization library provides read-side access which scales
linearly with the number of cores. It does so by allowing multiple
copies of a given data structure to live at the same time, and by
monitoring the data structure accesses to detect grace periods after
which memory reclamation is possible. `Userspace RSU <http://lttng.org/urcu>`_
Binary packages for Debian can be found under ``liburcu1`` for the
library and ``liburcu-dev`` for development files.
Minimum supported version of Userspace RCU library is 0.5.4,
but we recommend using latest available version.
It is crucial especially on non-Linux systems, as we got some compatibility
patches accepted to later releases of Userspace RCU.
OpenBSD, NetBSD and OS X platforms are supported from version 0.7.0.
.. _Installation from the source:
Installation from the sources
=============================
You can find the source files for the latest release on `www.knot-dns.cz <https://www.knot-dns.cz>`_.
Alternatively, you can fetch the sources from git repository `<git://git.nic.cz/knot-dns.git>`_.
After unpacking the sources, the compilation and installation is a
quite straightforward process using autotools.
.. _Configuring and generating Makefiles:
Configuring and generating Makefiles
------------------------------------
If you want to compile from Git sources, you need to bootstrap the ``./configure`` file first.::
$ autoreconf -i -f
For all available configure options run::
$ ./configure --help
If you have trouble with unknown syscalls under valgrind, disable recvmmsg by
adding a parameter ``--enable-recvmmsg=no`` to configure.
Knot DNS has also support for link time optimizations. You can enable
it by the configure parameter ``./configure --enable-lto=yes``. It is
however disabled by default as it is known to be broken in some
compiler versions and may result in an unexpected behaviour. Link
time optimizations also disables the possibility to debug the
resulting binaries.
If you want to add debug messages, there are two steps to do that.
First you have to enable modules you are interested in.
Available are: ``server, zones, xfr, packet, dname, rr, ns, hash, compiler``.
You can combine multiple modules as a comma-separated list.
Then you can narrow the verbosity of the debugging message by specifying the
verbosity as ``brief, verbose, details``.
For example::
$ ./configure --enable-debug=server,packet --enable-debuglevel=brief
$ ./configure --enable-debug=server,packet --enable-debuglevel=verbose
For more detailed information, see @ref{Debug messages}. ##TODO
In most simple case you can just run configure without any options::
$ ./configure
Compilation
-----------
(After running ``./configure`` you can compile Knot DNS by running
``make`` command, which will produce binaries and other related
files::
$ make
Knot DNS build process is safe to parallelize using ``make -j N``,
where N is number of concurrent processes. Using this option can
increase speed of the compilation.
For example to use maximum 8 concurrent processes you would use::
$ make -j 8
Installation
------------
When you have finished building the Knot DNS, it's time to install the
binaries and configuration files into the operation system hierarchy.
You can do so by executing ``make install`` command. When installing
as a non-root user you might have to gain elevated privileges by
switching to root user, e.g. ``sudo make install`` or ``su -c 'make install'``::
$ make install
Installation from packages
==========================
In addition to providing the packages in .DEB and .RPM format, the
Knot DNS might already be available in your favourite distribution, or
in a ports tree.
Installing Knot DNS packages on Debian
--------------------------------------
Knot DNS is already available from Debian wheezy upwards. In addition
to the official packages we also provide custom repository, which can
be used by adding::
deb http://deb.knot-dns.cz/debian/ <codename> main
deb-src http://deb.knot-dns.cz/debian/ <codename> main
to your ``/etc/apt/sources.list`` or into separate file in
``/etc/apt/sources.list.d/``.
As an example, for Debian squeeze (current stable) the Knot DNS
packages can be added by executing following command as the root user::
$ cat >/etc/apt/sources.list.d/knot.list <<EOF
deb http://deb.knot-dns.cz/debian/ <codename> main
deb-src http://deb.knot-dns.cz/debian/ <codename> main
EOF
$ apt-get update
$ apt-get install knot
Installing Knot DNS packages on Ubuntu
--------------------------------------
Prepackaged version of the Knot DNS can be found in Ubuntu from
version 12.10 (Quantal Quetzal). In addition to the package included
in the main archive, we provide Personal Package Archive (PPA) as an
option to upgrade to last stable version of the Knot DNS or to install
it on older versions of Ubuntu Linux.
We typically provide packages for all supported versions of Ubuntu
Linux including 5 year support for `LTS <https://wiki.ubuntu.com/LTS>`_
versions of Ubuntu Linux. At the time of writing this manual this
includes Ubuntu 10.04 LTS, 11.04, 11.10 and 12.04 LTS.
Adding official PPA repository for Knot DNS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To start installing and using software from a Personal Package
Archive, you first need to tell Ubuntu where to find the PPA::
$ sudo add-apt-repository ppa:cz.nic-labs/knot-dns
$ sudo apt-get update
$ sudo apt-get install knot
Running this sequence of commands will ensure that you will
install Knot DNS on your system and keep it up-to-date
in the future, when new versions are released.
Installing Knot DNS packages on Fedora
--------------------------------------
The RPM packages for ``Knot DNS`` are available in official Fedora
repositories since Fedora 18 (Spherical Cow). Look for ``knot``
package in your package manager. To install the package using Yum, run
a following command as the root user::
# yum install knot
Using official distribution repository is highly recommended, however you may
want to run ``Knot DNS`` on older releases of Fedora. In this case you can
set up an unofficial repository by creating @file{/etc/yum.repos.d/knot.conf}
file with the following content::
[knot]
name=Network.CZ Repository
baseurl=ftp://repo.network.cz/pub/redhat/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-network.cz
After performing this action, you can install ``knot`` package the same way
as described above. Please note that the unofficial repository contains only
builds for i686 and x86_64 architecture.
When upgrading to Fedora 18 or higher, backup the configuration and
switch to the latest package provided in the official repository by running the
following command as the root user:
# yum distro-sync knot
Installing Knot DNS from ports on FreeBSD
-----------------------------------------
Knot DNS is in ports tree under ``dns/knot``::
$ cd /usr/ports/dns/knot
$ sudo make install
Installing Knot DNS on Arch Linux
---------------------------------
Knot DNS is available official package repository (AUR)::
https://aur.archlinux.org/packages/knot/
Installing Knot DNS on Gentoo Linux
-----------------------------------
Knot DNS is available from Gentoo package repository::
https://packages.gentoo.org/package/net-dns/knot
@node Knot DNS Installation, Knot DNS Configuration, Knot DNS Resource Requirements, Top
@chapter Knot DNS Installation
@menu
* Required build environment::
* Required libraries::
* Installation from the sources::
* Installation from packages::
@end menu
@node Required build environment
@section Required build environment
GCC at least 4.1 is strictly required for atomic built-ins, but 4.2 or newer is recommended.
Another requirement is @code{_GNU_SOURCE} support, otherwise it adapts to the compiler available features.
Clang should work, but it is not officially supported.
Knot DNS build system relies on these standard tools:
@itemize
@item
make
@item
libtool
@item
autoconf >= 2.65
@item
flex >= 2.5.31
@item
bison >= 2.3
@end itemize
@node Required libraries
@section Required libraries
Knot DNS requires few libraries to be compiled:
@itemize
@item
OpenSSL, at least 1.0.0 (1.0.1 is required for ECDSA)
@item
zlib
@item
Userspace RCU, at least 0.5.4
@item
libcap-ng, at least 0.6.4 (optional library)
@end itemize
If libcap-ng library is available, Knot DNS will take advantage of
the POSIX 1003.1e capabilites(7) by sandboxing the exposed threads.
Most rights are stripped from the exposed threads for security reasons.
You can probably find OpenSSL and zlib libraries already included in
your system or distribution. If not, zlib resides at
@url{http://zlib.net}, and OpenSSL can be found at
@url{http://www.openssl.org}.
@menu
* Userspace RCU::
@end menu
@node Userspace RCU
@subsection Userspace RCU
liburcu is a LGPLv2.1 userspace RCU (read-copy-update)
library. This data synchronization library provides read-side
access which scales linearly with the number of cores. It does
so by allowing multiple copies of a given data structure to
live at the same time, and by monitoring the data structure
accesses to detect grace periods after which memory reclamation
is possible. (@url{http://lttng.org/urcu,Userspace RCU})
Binary packages for Debian can be found under @code{liburcu1} for the
library and @code{liburcu-dev} for development files.
Minimum supported version of Userspace RCU library is 0.5.4,
but we recommend using latest available version.
It is crucial especially on non-Linux systems, as we got some compatibility
patches accepted to later releases of Userspace RCU.
OpenBSD, NetBSD and OS X platforms are supported from version 0.7.0.
@node Installation from the sources
@section Installation from the sources
You can find the source files for the latest release on @url{www.knot-dns.cz}.
Alternatively, you can fetch the sources from git repository @url{git://git.nic.cz/knot-dns.git}
After unpacking the sources, the compilation and installation is
a quite straightforward process using autotools.
@menu
* Configuring and generating Makefiles::
* Compilation::
* Installation::
@end menu
@node Configuring and generating Makefiles
@subsection Configuring and generating Makefiles
If you want to compile from Git sources, you need to bootstrap the
@command{./configure} file first.
@example
$ autoreconf -i -f
@end example
For all available configure options run:
@example