Total Pageviews

Saturday, 6 July 2019

dns解析服务器程序-Knot Resolver

https://www.knot-resolver.cz/
Build Status Coverage Status Documentation Status
Knot Resolver is a caching full resolver implementation written in C and LuaJIT, both a resolver library and a daemon. The core architecture is tiny and efficient, and provides a foundation and a state-machine like API for extensions. There are three modules built-in - iteratorvalidatorcache, and a few more are loaded by default. Most of the rich features are written in Lua(JIT) and C. Batteries are included, but optional.
The LuaJIT modules, support DNS privacy and DNSSEC, and persistent cache with low memory footprint make it a great personal DNS resolver or a research tool to tap into DNS data. TL;DR it's the OpenResty of DNS.
Strong filtering rules, and auto-configuration with etcd make it a great large-scale resolver solution.
The server adopts a different scaling strategy than the rest of the DNS recursors - no threading, shared-nothing architecture (except MVCC cache that may be shared) that allows you to pin instances on available CPU cores and grow by self-replication. You can start and stop additional nodes depending on the contention without downtime.
It also has strong support for DNS over TCP, notably TCP Fast-Open, query pipelining and deduplication, and response reordering.

Packages

The latest stable packages for various distributions are available in our upstream repository. Follow the installation instructions to add this repository to your system.
Knot Resolver is also available from the following distributions' repositories.

Building from sources

Knot Resolver mainly depends on Knot DNS libraries, LuaJIT and libuv. See the Building project documentation page for more information.

Docker image

This is simple and doesn't require any dependencies or system modifications, just run:
$ docker run -Pit cznic/knot-resolver
The images are meant as an easy way to try knot-resolver, and they're not designed for production use.

Running

The project builds a resolver library in the lib directory, and a daemon in the daemon directory. It requires no configuration or parameters to run a server on localhost.
$ kresd
See the documentation at knot-resolver.readthedocs.io for more options.
from https://github.com/CZ-NIC/knot-resolver
-----

A mirrored repository of 
Requirements
============

./doc/requirements.rst

Installation
============

./doc/installation.rst

1) Install prerequisites

Debian based distributions
--------------------------
Update the system:
$ sudo apt-get update
$ sudo apt-get upgrade

Install prerequisites:
$ sudo apt-get install \
  libtool autoconf make pkg-config liburcu-dev libgnutls28-dev libedit-dev

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

Install optional packages:
$ sudo apt-get install \
  libcap-ng-dev libsystemd-dev libidn2-0-dev protobuf-c-compiler libfstrm-dev libmaxminddb-dev

Fedora like distributions
-------------------------
Update the system:
# dnf upgrade

Install basic development tools:
# dnf install @buildsys-build

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

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

Install optional packages:
# dnf install \
  libcap-ng-devel systemd-devel libidn2-devel protobuf-c-devel fstrm-devel libmaxminddb-devel

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.

2) Install Knot DNS

Get the source code:
$ git clone https://gitlab.labs.nic.cz/knot/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

Running
=======

./doc/operation.rst

1) Each server needs configuration file. Please see samples/knot.sample.conf,
project documentation, or man 5 knot.conf for more details.
Configuration file has to specify:
- storage for PID files, journal and timer databases etc.
- network interfaces
- served zones

E.g. use the default config file:
$ cd /etc/knot
$ mv knot.sample.conf knot.conf
Modify the config:
$ editor knot.conf

2) Prepare working directory
$ mv example.com.zone /var/lib/knot/

3) Start the server. This can be done by running the 'knotd' command.
Alternatively, your distribution should have an init script available, if you've
installed Knot using a binary package.

Start Knot in the foreground to see if it runs:
$ knotd -c myserver.conf

from https://github.com/CZ-NIC/knot

No comments:

Post a Comment